[erlang-bugs] R17 RC 2: Accessing Map

Loïc Hoguin essen@REDACTED
Tue Mar 25 14:38:05 CET 2014


Hopefully that specific part of the EEP will be dropped. You can already 
pattern match in function heads and return values easily, and doing it 
by pattern matching makes the code clearer.

On 03/25/2014 02:28 PM, Björn-Egil Dahlberg wrote:
> 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
>
>
>
> _______________________________________________
> erlang-bugs mailing list
> erlang-bugs@REDACTED
> http://erlang.org/mailman/listinfo/erlang-bugs
>

-- 
Loïc Hoguin
http://ninenines.eu



More information about the erlang-bugs mailing list