[erlang-questions] Re: Special syntax for dictionaries

Sergey Samokhin prikrutil@REDACTED
Tue May 11 19:32:33 CEST 2010


> 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.

-- 
Sergey Samokhin


More information about the erlang-questions mailing list