[erlang-questions] Re: Special syntax for dictionaries

Paul Fisher pfisher@REDACTED
Tue May 11 20:02:07 CEST 2010


+1

On Tue, 2010-05-11 at 12:32 -0500, Sergey Samokhin wrote:
> > Having too many meanings for the same symbol is too confusing and
> > error-prone.  I didn't use "=" because that already means "match".
> 
> You are right in that '=' is used here and there in Erlang.
> 
> We use '=' to bind variable name to its value: Var = 42.
> And also to pattern match on value: 42 = Var.
> 
> Why use yet another symbol to do these usual things?
> 
> I find the following syntax most convenient:
> 
> #{key = "val"}
> 
> It's like syntax for records, but without the record name.
> 
> Everyone who see this will say: Oh, it looks like records with no
> record type specified. It should be something like an anonymous
> record. And he will be almost right.
> 




More information about the erlang-questions mailing list