Hi there,
I have a script named ListModules.exs that contains the below,
defmodule ListModule do
def sum([]), do: 0
def sum([head | tail]) do
head + sum(tail)
end
end
How can I run the above from a windows shell and call the function sum([])?
I tried to run elixir -r ListModule.exs -e "ListModule.sum([])"
and I don’t get back anything. If I try to parse the list [1,2,3] to the list argument it gives me the following error: "!VAR:" was unexpected at this time.
Any help is welcome.
Regards,