So I have this weird occurrence in which I delete an element, 5, from a list, but when I return that new list, the output is coming out oddly. I've tested it so far, and there are multiple cases in which this occurs, not just in the code I have below, and also cases in which this doesn't occur, but is still very similar. One example in which it prints out fine is when I delete 10 or 12 instead of 5. So I know from doing lists:member() that 10 does exist within the Newlist, and when I do io:format(), the list comes out correctly. But when I actually return Newlist at the end, I am getting "\n\f" as output, and I'm not understanding why completely. I believe it has something to do with the list not being standard syntax, as stated in the documentation for io:format for what the control sequence ~w does:
"Writes data with the standard syntax. This is used to output Erlang terms. Atoms are printed within quotes if they contain embedded non-printable characters. Atom characters > 255 are escaped unless the Unicode translation modifier (t) is used. Floats are printed accurately as the shortest, correctly rounded string."
Any ideas for why this is occuring and solutions anyone might have so that when the list is returned, it will just be a simple list of [10,12]?
unload_shiptest3(Container) ->
Q = [5,10,12],
Newlist = Q -- [Container],
R = lists:member(10,Q),
io:format("~w~n",[Newlist]),
Newlist.