[Newbies] invoking a *class* method from a workspace
subbukk
subbukk at gmail.com
Mon Jun 4 17:40:47 UTC 2007
On Sunday 27 May 2007 9:44 pm, Bert Freudenberg wrote:
> There is a difference between "class variables" (which are like
> "static" variables in other systems, so they get their fare share of
> use) and "class instance variables" (very rarely used indeed). You
> see "class instance variables" only when you switch the browser to
> the class side. "Class instance variables" have a different value in
> each subclass and are private to the class-side. Hence they are not
> global and have lower-case names.
Thank you for explaining this in detail. I missed the fact that instance
variables listed by browser on the class side are different from those on the
instance. If I understood this correctly:
(class instance) variables - variables global to all objects instantiated
from a class
class (instance variable) - instance variable of the class (treated as an
object and therefore visible only to its methods and methods in its
subclasses).
BTW, I used the code below to inspect classes with explicit CIVs:
(Smalltalk values select: [ :c |
(c isKindOf: Class) and: [c class allInstVarNames size > 13 ] ])
collect: [ :d | { d . d class allInstVarNames size} ]
but this gave me classes that inherit them too. Is there a way to tease out
classes that *define* CIVs?
Regards .. Subbu
More information about the Beginners
mailing list