Accessing variables through sending messages

Noury Bouraqadi bouraqadi at ensm-douai.fr
Tue Jun 21 14:42:44 UTC 2005


Alex,

What is your intent? To hide instance variables only? This can be done 
"simply" using the subclass creation protocole. I worked on something 
like that in the ClassTalk system. In this context since instance 
variable names aren't (easily) available to developers, they have no 
choice except using accessors.

No extra-byte code is introduced. The only overhead is that you replace 
a direct access to an IV with an message.

Noury
Le 21 juin 05, à 16:29, Alexandre Bergel a écrit :

> Hello,
>
> I know there are some Self experts in this mailing list, that's why I 
> am asking a question related to it there. What would be the best 
> strategy to have variables not accessed by using their index, but 
> rather by sending messages correspondong to their accessors/mutators.
>
> I feel that an efficient implementation would require new bytecode, 
> therefore hardcoding this in the VM.
>
> Markus Denker has an implementation that use an object-as-compiled 
> trick to delay the recompilation of a method, but the assumption was 
> not to modify the VM.
>
> Anyone can confirm or infirm what I wrote ?
>
> Cheers,
> Alexandre
>
> -- 
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.iam.unibe.ch/~bergel
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>
--------------------------------------------------------------
Dr. Noury Bouraqadi - Enseignant/Chercheur
Ecole des Mines de Douai - Dept. G.I.P
http://csl.ensm-douai.fr/noury

European Smalltalk Users Group Board
http://www.esug.org

Squeak: an Open Source Smalltalk
http://www.squeak.org
--------------------------------------------------------------





More information about the Squeak-dev mailing list