2 ms·
The closest thing Erlang has to mutability is the process dictionary (get() and set()), which can be thought of as a sort of memcache for each process. Native
by chops 16y ago
The closest thing Erlang has to mutability is the process dictionary (get() and set()), which can be thought of as a sort of memcache for each process. Native variables themselves are immutable, without exception.
Unless you have a really good reason, using the process dictionary is generally frowned upon.
- rvirding 16y agoWhile the dictionary itself is mutable the data in it, both keys and values, is immutable like all data in Erlang. It is the same with ETS tables which behave more or less like processes, the data in them is also immutable.