[erlang-questions] Accessing a single value from MAPS

Pierre Fenoll pierrefenoll@REDACTED
Thu Oct 8 22:24:41 CEST 2015


One could also enforce clean syntax by only allowing a variable | atomic | braced_expr as keys in the grammar. 

Your key is too ugly? Put it in a variable. 

> On 08 Oct 2015, at 08:55, Tony Rogvall <tony@REDACTED> wrote:
> 
> Why not only support atom keys for the dot notation and let more complex keys use maps:get???
> That would cover most of my uses of maps ( but far from all )
> /Tony
>>> On 8 okt. 2015, at 16:47, Fred Hebert <mononcqc@REDACTED> wrote:
>>> 
>>> On 10/08, Fred Hebert wrote:
>>> Map.f.'d.e'.#{a@REDACTED=>ok} to go fetch the final 'ok'. Either that or you·
>>> support little chaining, but there's still plenty of ways to make this·
>>> terrible.
>> 
>> Oh also, if any form of chaining is required, it is now impossible to know if Map.3.5 is supposed to be Map.(3.5) or two maps, one with the key 3 and the key 5. I guess parentheses could make it work. But even with records this was kind of messy.
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-questions
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions



More information about the erlang-questions mailing list