|
|
|
|
|
by jerf
5100 days ago
|
|
Erlang values are not mutable. You can't have a 4, lose the execution pointer to another process, and when it comes back you suddenly have a 5 in that variable. (Barring arbitrary C, of course.) That's the aspect of "immutable" that matters from a multithreading point of view. For most of what Erlang does, it would be fine to have mutable variables but immutable values, as if everything were as immutable as a Python string but you could freely reuse variable labels just as you can set a = "A", then a = "B" in Python. I think that's basically what Go does, though I haven't quite studied it enough to be sure. |
|
Which is of no relevance to Erlang in the first place, since it does not expose threads to the developer.
> I think that's basically what Go does, though I haven't quite studied it enough to be sure.
Go has mutable structures and mutable bindings.