[erlang-questions] Maps single value access not implemented
Sina Samavati
sina.samv@REDACTED
Mon Feb 10 15:39:37 CET 2014
Loïc Hoguin <essen@REDACTED> writes:
> On 02/10/2014 01:54 PM, Sina Samavati wrote:
>> Loïc Hoguin <essen@REDACTED> writes:
>>
>>> On 02/10/2014 01:10 PM, Sina Samavati wrote:
>>>> I feel much better with that. I guess something in *EEP 43* made Maps complex,
>>>> I mean, we don't really need all those capabilities for Maps as proposed in
>>>> _EEP 43_. For example (this is just a friendly feedback not a *complaint*),
>>>> I think the '=>' operator is enough for both adding a new key and updating an
>>>> existing key.
>>>
>>> The := operator is *very important*. It pretty much means "crash if my
>>> code is messed up". This is essential.
>>
>> That's true from that perspective.
>> From another perspective: add or update it, I don't want you to shout at me
>> "Hey, there's no such key", because it will or will not be used. That's it.
>
> There are some uses of maps where you don't care about whether the key
> already exists. But in all the places where today you would use a
> record incorrectly (over multiple modules/processes), the := is vital.
Maybe I'm wrong and my *opinion* isn't good at all, actually that's why I'm in
this conversation, just to learn more.
--
Sina Samavati
Software engineer
https://github.com/s1n4
https://twitter.com/sinasamavati
More information about the erlang-questions
mailing list