Special syntax for dictionaries

Tim Fletcher mail@REDACTED
Wed May 5 14:17:17 CEST 2010


> While your examples might work if the value is a simple constant or
> variable allowing any legal general expression will cause problems.
> How would you interpret <{erlang:list_to_integer("123")}> ? Note that
> white space is usually ignored so making white space significant here
> would be creating a special case for just this.

You're right, that's definitely not workable.

> This was the main reason that = is used in the record syntax. While ~
> may look strange using : will cause problems. How about =? Though this
> may force you to parenthesize some expressions.

I think = is fine aesthetically, but Richard notes in his frames
proposal that it could also be confused with existing syntax that uses
=. Adopting the Ruby style "arrows" would be another option:

  <{author=>"Mike", erlang=>list_to_integer("123")}>

Looks clear enough, but might be a bit too verbose for typing out?

Tim



More information about the erlang-questions mailing list