Quantcast
Channel: Top level assignment - Stack Overflow
Browsing all 2 articles
Browse latest View live

Answer by Steve Vinoski for Top level assignment

There are no global variables in Erlang. You can use a function instead, like this for example:-module(test).-export([main/0]).x() -> 1.main() -> io:format("~p~n", [x()]).For something as simple...

View Article



Top level assignment

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...

View Article
Browsing all 2 articles
Browse latest View live




Latest Images