[erlang-bugs] R17 RC 2: Accessing Map

Björn-Egil Dahlberg egil@REDACTED
Tue Mar 25 14:28:34 CET 2014


Single value access syntax i.e., V = M#{ 'a_key }, will not be a part of 
Maps. At least not in OTP 17.0.

Implemented Maps functionality in OTP 17.0 will be described in the 
reference manual and vill be a subset of what's described in the EEP.
Note "will be" .. currently not in master. =)

Perhaps you are wondering, "why not?"

Two issues,

1) We don't really like the current syntax proposal,
2) It is unclear if it is really needed, and if it is needed .. if this 
is the way forward. I would prefer some sort of generic lensing instead 
.. but we are getting way ahead of ourselves here.

// Björn-Egil, Erlang/OTP

On 2014-03-25 13:47, Pieter Bouwer wrote:
> Hi,
>
> Sorry if this is a duplicate, but I couldn't find a bug report dealing 
> with this.
>
> In the EEP (43 - http://www.erlang.org/eeps/eep-0043.html) for the map 
> data type, syntax for accessing the value associated with a key is 
> suggested as, e.g. key 'a_key' in map M:
>
> |V = M#{ 'a_key' }.|
>
> However, if I try to do this (from the shell), I get a syntax error:
>
> >     M#{'a_key'}.
>  * 1: syntax error before: '}'
>
> I don't know if this is still planned as part of the syntax - the EEP 
> was released in April last year.
>
> -- 
> Regards,
> Pieter Bouwer
>
>
> _______________________________________________
> erlang-bugs mailing list
> erlang-bugs@REDACTED
> http://erlang.org/mailman/listinfo/erlang-bugs

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20140325/4dcf34fb/attachment.htm>


More information about the erlang-bugs mailing list