[squeak-dev] Re: Instance variable access in superclasses.

Greg A. Woods; Planix, Inc. woods at planix.ca
Wed Nov 26 20:20:31 UTC 2008


On 26-Nov-2008, at 1:32 PM, Eliot Miranda wrote:
>
> Then choose a different class than SmallInteger to make your point.

Sorry, it wasn't my choice in the first place.

I'm not sure it's relevant to my point either, but I'm too ignorant  
about the details to know for sure so I'll take your word for it.

I think any normal class would do, though perhaps any user-defined  
class would be best -- the point is simply that subclasses are defined  
by adding stuff to the definition of an existing class hierarchy.   
Whether the additions change the behaviour of existing methods or not,  
add new instance variables, or not, or add new methods or not, doesn't  
really take away from the fact that the subclass is defined by adding  
new definitions to its superclass.

Any class (except I think Object itself of course) is really just the  
combined definition of all the superclasses in its hierarchy.  If it  
weren't for "super" (and some other meta-level stuff I think we can  
safely gloss over) there would be no real way for an object to  
distinguish which parts of itself are from which levels in the class  
hierarchy that it is entirely derived from.  At least that's how I've  
come to understand classes and inheritance in Smalltalk-80.

-- 
					Greg A. Woods; Planix, Inc.
					<woods at planix.ca>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20081126/bd41a823/PGP.pgp


More information about the Squeak-dev mailing list