[erlang-questions] wierd list comprehension outcomes

Imants Cekusins imantc@REDACTED
Sun Jan 25 14:47:39 CET 2015


For adding items to lists:

this is bad:
[ any() | Not_a_list ]

ok:
[ One_item | T_List ]

The "T_List" must be a list - even if an empty one: [ ].
One_item ideally is not a list: atom, number, tuple, etc

for "glueing" lists together, use
lists:append/1,2



More information about the erlang-questions mailing list