[squeak-dev] Re: About classVariables

Craig Latta craig at netjam.org
Mon Oct 13 21:00:58 UTC 2008

      A couple of elaborations...

 > If I compile a class-side method for Array, and I use a class
 > variable, conceptually it's one of Array's class variables I'm using,
 > yes? What the class variables of (Array class) might be is irrelevant.
 > Yes, during compilation, Metaclass>>scopeHas:ifTrue: delegates to the
 > receiver's sole instance, but that doesn't mean that a metaclass has
 > the same class variables as its sole instance.

      In particular, in Metaclass>>scopeHas:ifTrue: we're referring to 
the scope defined by the receiver of the method we're compiling (Array), 
not the object being asked this scope question (Array class). There's 
probably a better name than "scopeHas:".

 > To say otherwise is to introduce a conceptual inconsistency into
 > the system: the class variables of an object are defined by its class,
 > except if that object is a metaclass. Further, suppose the class
 > variables pool for Metaclass were not empty. By your logic instances
 > of Metaclass don't have access to it.

      That is, having put an entry into the class variables pool for 
Metaclass, if I then ask (Array class) for its class variable names, I 
won't get the new class variable name in my answer if it just delegates 
to its sole instance.


Craig Latta
improvisational musical informaticist
Smalltalkers do: [:it | All with: Class, (And love: it)]

More information about the Squeak-dev mailing list