[squeak-dev] Re: private instance variables NOT objects? (Wikipedia)

Andreas Raab andreas.raab at gmx.de
Mon Oct 25 22:40:23 UTC 2010


On 10/25/2010 4:17 PM, Jecel Assumpcao Jr. wrote:
> Yes, but there would be significant costs. You would have to solve issus
> of infinite regress (how do you represent the instances variables of the
> instance variables? And the instance variables of the instance variables
> of the instance variables? And so on....) and even then they would add
> significant overhead to the implementation.

FWIW, Tweak reifies instance variables in its fields. Also, class 
variables are reified (as Associations).

Cheers,
   - Andreas

> "Would anything good come from having instance variables be objects?"
>
> Debuggers, browsers and other tools could be written in more object
> oriented and less imperative style. In fact, the compiler does create
> objects for the instance variables while doing its job but throws these
> objects away when it is finished.
>
> "Is there some way to have the advantages of variables as objects
> without all the costs?"
>
> The compiler shows it can be done - only have them be objects when you
> happen to be looking at them but not otherwise. Self mirrors are a great
> example of this - when you create a mirror on some object, it seems to
> be a set of "slot" objects. You can send many interesting messages to
> the individual slots as well as to the whole set. For any object on
> which you don't have a mirror, no slot objects exist.
>
> -- Jecel
>
>
>




More information about the Squeak-dev mailing list