Question on "The Erlang Way"

Alex Peake apeake@REDACTED
Sat May 18 03:03:53 CEST 2002


I am new to Erlang. Can someone help me to "think the Erlang way" on the
following (I am from the Lisp world):

1) I want to create a "global" to the application dict. Is this best done by
spawning a process that manages the dict (like the number analyser sample in
the Book)? It seems that because of the "assign once" strategy, regular
variables do not work (dict:store returns a new Dict).

2) How do you build functions to have optional arguments, like "key"
arguments in Lisp (there are too many permutations to use a pattern/guard
for each)? (Lisp example: (create-attr "First_Name" varchar :dom-len 20
:nullable t) -- the first two arguments (name and domain) are required, but
others dom-len, nullable and many others are optional (and have default
values).






More information about the erlang-questions mailing list