[erlang-questions] Clueless am I

Richard A. O'Keefe ok@REDACTED
Wed Apr 27 02:08:13 CEST 2016

On 26/04/16 7:59 PM, Konstantin Vsochanov wrote:
> Actually, there is one - process dictionary
> But you have to use it with care.

The process dictionary facility is not strictly speaking
a DATA STRUCTURE. (You could call it a data OBJECT.)
In any process, there is only one process dictionary.
You cannot create new ones.  You cannot pass them
as arguments.  You cannot return them from function.
You cannot bind a variable to a process dictionary.
The keys and values stored in a process's dictionary
are themselves immutable.

Process dictionaries, except for their scope, are much
more like ETS and DETS tables than they are like lists
or tuples or maps.

(Come to think of it, there *is* a C analogue for the
process dictionary, and that's the unique hash table
manipulated by the traditional hsearch() function.
#include <search.h> didn't give you any way to
create additional hash tables.  No data type, only a
single data object.)

More information about the erlang-questions mailing list