Earlier quoted context omitted.
It's not mutated or changed it points to a totally different memory location. It's called immutable data not immutable identifiers. Immutable data is what eliminates a large number of potential bugs. Having a ton of intermediate variable names could actually be a source of bugs plus you have to care if someone reuses the name above the point in code you used it. By allowing rebinding you only care about the code belo…
> It's called immutable data not immutable identifiers. immutable/mutable data and immutable/mutable identifiers are two different things. One is not called the other, they are separate things really. > It's not mutated or changed it points to a totally different memory location So you said it yourself. It points to a different memory location. So how is x not mutated then? "Mutated" is a synonym for "change", or so…
def t() do
x=1
f=fn -> x end
x=2
f.()
end
will return 1