Hacker News new | past | comments | ask | show | jobs | submit login

> ...but the added chapter on maps give you errors whe using erlang 18...

Are you talking about the section entitled "What Maps Shall Be", or are you talking about the section entitled "Stubby Legs for Early Releases"?

If you're talking about the former, then the prose in the previous section "EEP, EEP!" makes it pretty clear that the maps spec is not fully implemented in Erlang, and that "What Maps Shall..." describes the spec, rather than the implementation.

If you're talking about the latter, then I'm not sure what's up on your end... the examples in "Stubby Legs..." work for me:

  Erlang/OTP 18 [erts-7.2.1] [source] [smp:2:2] [async-threads:10] [hipe] [kernel-poll:false]
  
  Eshell V7.2.1  (abort with ^G)
  1> SomeMap = #{a => x}.
  #{a => x}
  2> #{a := X} = SomeMap.
  #{a => x}
  3> X.
  x
  4> SomeMap#{a := update, b => new}.
  #{a => update,b => new}
  5> Y=3, #{Y => Y-1}.
  #{3 => 2}
  6> 
> For a beginners it sound very strange that a basic structure like a maps is not well consolidated in a language as erlang.

The maps module is very, very, very new. As mentioned in the "Mexican Standoff" section, dict [0] was more-or-less the go-to module when you wanted a K/V store [1] in Erlang. The maps module [2] (and map type) adds a lot of nice syntax for working with K/V datatypes.

[0] http://erlang.org/doc/man/dict.html

[1] And had no need for ETS, or Mnesia, or similar, naturally.

[2] http://erlang.org/doc/man/maps.html




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: