4 ms·
In Smalltalk, the only way how to communicate to objects is by sending messages. The way how they react on the messages is full the responsibility of objects, a
by xkriva11 7y ago
In Smalltalk, the only way how to communicate to objects is by sending messages. The way how they react on the messages is full the responsibility of objects, and they can refuse them. This decision is strictly late-bound because all message passing in Smalltalk is late-bound. You may say that all the methods in Smalltalk are "public", but it is not the very same meaning as in other languages.
The objects store the state in instance variables. You cannot access the instance variables of objects from outside of the object. All instance variables are "protected" in the terminology of C++.
- tresilience 7y ago> The way how they react on the messages is full the responsibility of objects, and they can refuse them. Thereby any further protection is totally up to the programmer right?
- xkriva11 7y agoYes. It is actually very easy to extend Smalltalk to support private/protected methods (message bytecode based on the protocols, for example). But Smalltalk would need to do these checks in run-time because all message sends are late-bound.
- tresilience 7y agoThanks! Can you point me to where I can find out more about the eval-"loop" that the entire Smalltalk runs on?
- xkriva11 6y agoCheck the Blue Book: http://stephane.ducasse.free.fr/FreeBooks/BlueBook/Bluebook.pdf http://stephane.ducasse.free.fr/FreeBooks/BlueBook/Bluebook....