[BUG?] ProtoObject class superclass = nil

Marcus Denker marcus at ira.uka.de
Sat May 25 10:16:06 UTC 2002


Hi!

> 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! =)
> 
> 

Everything is an Object. So a Class ist an Object, the sole instance of
it's MetaClass (e.g. Object class). But this Metaclass is an Object, too.
And (as with allmost any other Object in squeak) it thus has to be
a subclass of Object.  
And then there is behaviour that's specific to all instances of Metaclasses
(e.g. new). This can nicely be put in some Class (like "Class" or
'Behaviour'). That's it. 
 
Of course, this whole thing is *really* complex without reason: We don't
gain much from it. The Metaclass Hierachy was much simpler in Smalltalk76,
and there has been some discussion to go back to such a simpler scheme.
Or (as Anthony suggested), we could get rid of Metaclasses alltogether:
http://lists.squeakfoundation.org/pipermail/squeak-dev/2002-February/010043.html

(I really like that idea...)


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

Have a look at Stephane's "Reflective Programming" lecture:
http://www.iam.unibe.ch/~scg/Teaching/Reflective/


           Marcus

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




More information about the Squeak-dev mailing list