Search code examples
erlangerlang-shell

Erlang maps syntax error on one of my installations


I installed Erlang on my Mac (OS X) and my Ubuntu 14.04 pc. Trying to create a map works on the Mac but the exact same code yields an error on my Ubuntu pc. I have tried it on one other computer and it worked there as well. This is the code:

Map = #{"hi" => 42} .

It's the sample code from here. On my Ubuntu install it says syntax error before {.

Could it be some kind of problem with my version of Erlang? I installed it from aptitude. When I start it, it says "Eshell V5.10.4".

It is the same if I write the code in a file and try to compile it from the shell.


Solution

  • Your Erlang installation is too old. 5.10.4 was the version number of the emulator released in R16B03, while maps were introduced in 17.0.

    If you need up-to-date Erlang packages for Ubuntu, you can find them here. Either add the repository as described at that page, or scroll down to download packages manually. (Full disclosure: provided by my employer)