Earlier quoted context omitted.
> Elixir is entirely immutable - it has to be as it just runs on the Erlang VM! No, variables are mutable in Elixir. Interactive Elixir (1.1.0-dev) iex(1)> x=1 1 iex(2)> x=2 2 Notice how x is 1 then x is 2. Variable x mutated. In Erlang: 1> X=1. 1 2> X=2. ** exception error: no match of right hand side value 2 Variables are immutable in Erlang. I suspect you misunderstood gp's post and thought they were talking about…
I did not misunderstand. You're calling renaming something mutation. It isn't. You're referring to static single assignment. This has been covered before in more detail than I care to go into.
I think you are confused though ;-) There is no renaming -- x=1, then x=2. Nothing was renamed. x wasn't renamed, it is still variable x. 1 and 2 wasn't renamed, it is still 1 and 2 (could have been a map, or list for example). So what do you think was renamed there?
> You're referring to static single assignment.
No, I am referring to immutable variables. Variables are not changing, they are immutable in Erlang. In Elxir variables change, they can be assigned different values later in a function. If that is not a change i.e. a mutation I don't know what is.