I have this code that is supposed to print the numbers 1 to N-1 in a list, but I
in here won't append to the list.
enum(N,[],N) -> [];
enum(N,L,I) ->
io:format("current number: ~w~n", [I]),
L = L ++ I,
enum(N,[],I+1).
enumFunc(N) -> enum(N,[],1).
When I run sample:enumFunc(100)., it returns exception error: no match of right hand side value [1]
Please help me solve this. Thanks.
Warning: the result of the expression is ignored
. – Dwarf