[squeak-dev] re: About classVariables
Craig Latta
craig at netjam.org
Mon Oct 13 03:19:25 UTC 2008
Hi Stef--
> To my stupefaction I discovered that the classVariables of a class are
> not the same as the ones of its metaclass.
>
> TheRoot classVarNames ~= TheRoot class classVarNames
>
> Does any body have some ideas why this is like that? For me this is a
> conceptual bug.
Actually, metaclasses don't really have class variables at all.
Class variables are defined by Class, which is a sibling of Metaclass,
not a superclass. There's a method in Behavior which just answers a new
empty Set for classVarNames; this is what you're invoking when you
evaluate [TheRoot class classVarNames].
I guess that's in there so that "explain" and "browse class var
refs" behave as someone in the past wanted them to. Do you have a need
which conflicts with this? Do you actually need to use TheRoot's class
variables in code where (TheRoot class) is the receiver?
-C
--
Craig Latta
improvisational musical informaticist
www.netjam.org
Smalltalkers do: [:it | All with: Class, (And love: it)]
More information about the Squeak-dev
mailing list
|