[erlang-questions] Special syntax for dictionaries

Robert Virding rvirding@REDACTED
Fri May 7 02:53:31 CEST 2010


As has been mentioned we are actually discussing the syntax of two
separate things here: frames/structs and dicts/"hashmaps".

Frames/structs are an extension/replacement/improvement on records.
Both give you a structure with named fields but where records are
compile time and static not Erlangy, structs/frames are runtime and
dynamic and much more in keeping with Erlang. But they are not an
alternative to dicts, or at least they were not envisioned to be that.
One fear I have always had with frames/structs (honestly I have :-) )
is that people would start using them as an alternative to dicts for
which they were not intended, though I was thinking more of the
problems of implementing them. That being said I am still all for them
and will gladly take a discussion on syntax and properties. I will
even accept the ~.

I personally don't think that we need or should have a special syntax
for dicts, it would in one sense defeat the purpose of them. My basic
principle has been that there is no "best" implementation of a dict so
by having a number of different implementations with the same
interface so the could more easily test and choose. I will soon (real
soon now) be adding a tree dict.

Another reason for not wanting a special syntax for dicts/hashmaps is
that I would like to avoid adding more special syntax where it isn't
absolutely necessary and I don't feel that these really need it.

Robert


More information about the erlang-questions mailing list