top | item 39630786

(no title)

NlightNFotis | 2 years ago

"binding" is a PLT term, denoting the association between a name and a value.

It's a higher level concept than the variable - a mutable binding is what people usually refer to as a variable, and an immutable binding is the correct term for what people refer to an "immutable variable" (an oxymoron, if you think about it).

discuss

order

skitter|2 years ago

Immutable variable isn't a oxymoron. It can still vary between instantiations. If you have (a)=>{const b = a}, b can have different values even though it can't be reassigned.

NlightNFotis|2 years ago

In the case of the code that you have cited, these are all different elaborations of the binding at the invocation of the lambda, due to the interplay between activation records and scope rules.

It's not really an "immutable variable" - it's a local binding getting bound to different values on each scope entry.

EDIT: By the way, the `b` binding in your code can be modified. Did you mean `const b = a;` ?