Quantcast
Channel: Top level assignment - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Top level assignment

$
0
0

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?


Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>