2

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.

riQQ
  • 9,878
  • 7
  • 49
  • 66
  • possible duplicate of [Why do I get syntax error before: '{'?](http://stackoverflow.com/questions/31589190/why-do-i-get-syntax-error-before) – legoscia Jul 23 '15 at 16:42

1 Answers1

3

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)

Hadrien TOMA
  • 2,375
  • 2
  • 22
  • 32
legoscia
  • 39,593
  • 22
  • 116
  • 167