[erlang-questions] Re: Special syntax for dictionaries

Jayson Vantuyl kagato@REDACTED
Tue May 11 20:26:11 CEST 2010


I would note that #{...} is used for string interpolation in Ruby.  
Ironically, I generate some Erlang from Ruby, so this would make for  
interesting escaping for me.

That said, I think this is a fantastic syntax.

Sent from my iPhone

On May 11, 2010, at 10:32 AM, Sergey Samokhin <prikrutil@REDACTED>  
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.
>
> -- 
> Sergey Samokhin
>
> ________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED
>


More information about the erlang-questions mailing list