Hi Eliot, Thanks. I know what class variables are, I was just asking if there is a Slot-like meta-object in the implementation :).
Cheers, Doru On Wed, Nov 26, 2014 at 7:36 PM, Eliot Miranda <[email protected]> wrote: > Hi Tudor, > > On Wed, Nov 26, 2014 at 6:02 AM, Tudor Girba <[email protected]> wrote: > >> Hi, >> >> As far as I see, the class variables are not slots. Is that correct? >> > > That's right. They're associations in class pools, and are visible in the > instance-side and class-side methods of the class and all its subclasses. > See Class>>bindingOf: and Class's inst var classPool. Shared pools are > similar. A shared pool stores its variables in its class pool, but other > classes can have its class vars in scope by including the shared pool in > its pool dictionaries. > > >> If not, how do I get the slots? >> > > Well, just for clarity (at least I hope it'll bring clarity). One can > access the variables via > > MyClass classPool associations > > Note that these are entirely different from class instance variables, > which are inst var slots in the class object. These hold things like the > class's superclass, its method dictionary, etc. But one can add inst vars > to one's own class. There are many examples of this. Since these slots > are per-class every class gets its own copy of the slot, and because these > are inst vars, they are only in scope in class-side methods of the defining > class and subclasses. > > HTH > > >> >> Cheers, >> Doru >> >> >> -- >> www.tudorgirba.com >> >> "Every thing has its own flow" >> > > > > -- > best, > Eliot > -- www.tudorgirba.com "Every thing has its own flow"
