[erlang-questions] If you are homesick for object.selector

Richard O'Keefe <>
Tue Jan 29 01:23:56 CET 2013


Speaking of alternative models, one approach is to move
from thinking of

	<thing>
         ::= <scalar value>
          |  [{<key>,<thing>]

where you are thinking of a thing as a tree with edges
labelled by keys and leaves labelled with scalars, to

	<thing>
         ::= finite map [<key>] -> <scalar value>

for which an interface like

    thing_has(Thing, Path)
    thing_get(Thing, Path)
    thing_get(Thing, Path, Default)
    thing_put(Thing, Path, Value)
    thing_add(Thing, Path, Value)
    thing_rem(Thing, Path)

makes sense.  This thing could really be a tree underneath,
or it could be a dictionary with paths as keys and leaves
as values, or it could be some sort of factored representation.
Or it could be a process, with the paths being used as keys in
that process's dictionary.

It may _look_ like a duck; it may _quack_ like a duck;
but it's _really_ a Psychon.
( http://en.wikipedia.org/wiki/Maya_(Space:_1999) )

Out of the many things that are not clear to me, one of them
is a typical total number of paths relevant to one of these
game characters we have heard so much and seen so little of.

At some point, it would make sense to annoint one dictionary
_interface_ and provide special brief syntax for using it




More information about the erlang-questions mailing list