Re:Erlang for Skeptics
by frognibble on Sunday November 29, 2009 @12:11PM
(#966498)
Variable bindings in Erlang are immutable to support the pattern matching. If variable bindings were not immutable, then Erlang would need syntax to distinguish between free and fixed variables in a pattern. The "=" in Erlang is pattern match, not assignment. Erlang could make bindings mutable without impacting the concurrent nature of Erlang because values would still be immutable.
[ Parent
| on HN ]
It is as you say, you must make a choice, trying to have both becomes very confusing. In LFE (Lisp Flavoured Erlang) I went the other and added proper scoping. It is the lack of scoping which I consider to be the most confusing and has caused some strange features.
Having mutable variables is definitely possible but I don't really see the problems with immutable ones. You get used to it very quickly.
It nevertheless is confusing for somebody who doesn't know erlang. Even prolog uses different symbols for matching a variable and for defining a clause.
And Turkish is confusing for someone who doesn't know Turkish. If you want to use a language, learn it.