Remix.run Logo
▲ kragen 15 hours ago

However, it would be impossible to implement a #toggle method in Smalltalk that behaves like this, because you're calling it on the singleton True (or False) object; Smalltalk local variables, like Lisp variables, are references to objects rather than objects themselves.

(You obviously know this, but it might be a surprise to many people reading this thread.)

▲pjmlp 14 hours ago | parent [-]

Yes, but that is orthogonal how primitives and reference types get exposed to the developer.

Something like toggle is also impossible in languages that favour immutability and forward progress requires creating new variables, like several functional and logic languages.