[BUG?] ProtoObject class superclass = nil

Blaine Buxton blainebuxton at hotmail.com
Fri May 24 16:04:34 UTC 2002


>From: Marcus Denker <marcus at ira.uka.de>
> > 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).

I noticed this too and I knew it was getting to Behavior's new...So far so
good...=) Remember, I'm just trying to get my head around this...=)

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

And here's my question: WHY? It seems when I ask a Metaclass instance for
its superclass, it returns another Metaclass instance except for this case.
Why wouldn't you want a special Metaclass instance to handle this special
case? It seems strange to me to have the ProtoObject Metaclass instance to
return Class in this case. But, then again it could be strange because of my
ignorance. Teach me oh Jedi Master! =)


>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...

Not at all...Clear as a bell...=) It's nice to have a squeak image next to
you when reading though...=)

I'm trying to figure this out because I'm very intrigued by metaobject
protocols and it's one of things I would like to play with for fun...=)

Blaine Buxton

_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx




More information about the Squeak-dev mailing list