[BUG?] ProtoObject class superclass = nil

Marcus Denker marcus at ira.uka.de
Fri May 24 11:02:06 UTC 2002


On Thu, May 23, 2002 at 05:12:26PM -0500, Blaine Buxton wrote:
> 
> So, now, my question is why does ProtoObject's metaclass (ProtoObject class) 
> return an instance of Class and NOT nil or metaclass instance used for nil.
> 

Let's look at how "Object new" works... look at the class methods
of both Object and ProtoObject: They don't implement "new". 

If you search for new, you'l fing the "new" that invokes the 
primitive only in class Behaviour (instance Method). 

So somewhere we need to have a point where a superclass of a metaclass
is the normal (non-Meta) class "Class".

The hierarchy is like this:

              Object
                  |
              Behavior
                  |
              ClassDescrition
                  |
  nil         Class
   |              |
 ProtoObject--ProtoObject class
   |              |
 Object ---  Object class  

(Bottom --> Top: 'is subclass of',
 left   --> Right 'is instance of')
 

So classes are instances of Metaclasses which are subclasses of Class
(which is subclasses of Object).

And there is 'Metaclass'. Thats's the Class of a Metaclass. Thus:
"Object class class" is "Metaclass".

Hope this was not too confusing...

        Marcus

-- 
Marcus Denker marcus at ira.uka.de  -- Squeak! http://squeakland.org




More information about the Squeak-dev mailing list