| ▲ | pjmlp 2 days ago | ||||||||||||||||
Eiffel or Smalltalk are two languages, among others I could chose from, where primitives and others types are differently implemented, yet unless you dive into the nitty gritty details, they look exactly the same to the developer as the compiler handles them exactly the same, and there are no extension methods to be seen. | |||||||||||||||||
| ▲ | kragen 2 days ago | parent [-] | ||||||||||||||||
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.) | |||||||||||||||||
| |||||||||||||||||