|
|
|
|
|
by ricardobeat
829 days ago
|
|
I meant in the context of writing code - you’ll never hear anyone refer to their “bindings”. It breaks down with the simple `let a = 22; let b = a` example where the tentacle/binding metaphor can lead to wrong intuition of why a change to the value of a is not reflected in b. |
|
> When a binding points at a value, that does not mean it is tied to that value forever. The = operator can be used at any time on existing bindings to disconnect them from their current value and have them point to a new one
In this case:
The binding a points to the value 22. The binding b points to the same value that a points to, namely 22. The binding a now points to a different value 23. The binding b is not affected.I've linked it a few times in this thread, but see the equivalent article for Python, which explains it clearly: https://nedbatchelder.com/text/names1.html
(It cannot break down because it's how the language works.)