Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!uxc!uxc.cso.uiuc.edu!uxd.cso.uiuc.edu!osiris.cso.uiuc.edu!goldfain From: goldfain@osiris.cso.uiuc.edu Newsgroups: comp.lang.smalltalk Subject: Re: Variable scoping in Smalltalk Message-ID: <12100018@osiris.cso.uiuc.edu> Date: 31 Mar 89 05:56:00 GMT References: <935@cs-spool.calgary.UUCP> Lines: 26 Nf-ID: #R:cs-spool.calgary.UUCP:935:osiris.cso.uiuc.edu:12100018:000:1271 Nf-From: osiris.cso.uiuc.edu!goldfain Mar 30 23:56:00 1989 ] Written 9:13 am Mar 29, 1989 by johnson@p.cs.uiuc.edu : ] > From Ken Warner: ] > How does one find out the super-class so that one can access the super ] > class-pool variables without explicitly stateing the name of the ] > super class? ] ] Various people answered that "self class superclass" would give you the ] superclass of an object's class. This might be the direct answer, but it ] might not be answering the real question. I don't see why there can be ] any problem in accessing pool variables, and wonder if Ken isn't trying ] to access some other kind of variables. Subclasses use the exact same ] copies of class variables as the superclass that defines the variables. ] I think that pool variables are also inherited, so they shouldn't be a ] problem either. So if one simply wants to get the value of superclass pool variable "Foo", one can simply ask for Foo, without even finding the superclass. On the other hand, if one really wants to know just what class variables are defined in the superclass, the message: self class superclass classPool will give the desired answer, while: self class classPool will give a superset consisting of those found by the former message plus those class variables defined in self class.