I was trying to create a function using a higher-order function in Erlang. To my surprisement, this seems to not be okay. Here's a simplified example of the error I'm getting.
-module(test).-export([main/0]).X = 1.main() -> io:format("~p~n", [X]).
And in erl:
> c(test).test.erl:4: syntax error before: Xtest.erl:7: variable 'X' is unbounderror
Do you have any idea what could be done to circumvent this?