You donâ(TM)t seems to understand what immutability is.
Whenever you set x = 1, in Erlang you canâ(TM)t say x = x + 1, mathematically it makes sense.
Nevertheless, you can assign y to be x + 1.
But the key is to pass the data as a parameter of your functions. After all, the data is what we care about.
Say you have a function foo, it takes data and a modification function.
Foo is pure, no side effects inside foo.
Well you can reason about foo and known ahead of time what the output of foo will be.
Thatâ(TM)s transparent reference.
So you do not need variables. You need functions to return need data based on passed data.
Itâ(TM)s simple. Very very simple.