Special syntax for dictionaries

Tim Fletcher mail@REDACTED
Wed May 5 09:32:38 CEST 2010


> Would not using ":" make it look like a function call
> (to another module)?

Yes, if the values are atoms and you don't put spaces before/after the
semicolon. Whilst that would be similar to a mod:fun call, there are
no brackets, so technically there's no ambiguity. Currently that usage
of the semicolon is illegal syntax, so presumably it could be made to
work. And to make it really look like a function call you'd have to be
using keys and values that are similar to those used to identify
modules and functions, like this:

  <{erlang:list_to_integer}>.

I think both of these look sufficiently different from a mod:fun call
though:

  <{erlang: list_to_integer}>.

  <{erlang : list_to_integer}>.

Maybe it's my exposure to languages that use the semicolon for this
purpose, but it feels more natural than "~".

Tim


More information about the erlang-questions mailing list