[BUG?] ProtoObject class superclass = nil

Blaine Buxton blainebuxton at hotmail.com
Thu May 23 22:12:26 UTC 2002


Hey,
I thought this was interesting. I looked at the class definition of 
ProtoObject and got the following:

ProtoObject subclass: #ProtoObject
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'Kernel-Objects'.
ProtoObject superclass: nil

Strange, but reasonable. I guess we need an instance to subclass from 
initially, but later we set the superclass to nil. I got the following when 
I inspected things in the workspace:

ProtoObject class superclass (returned Class class)

But, I got the following when I did this:

ClassDescription class superclass (returned Metaclass for Behavior class)

Now, it seems I can use any class for the above and I get the same type of 
object (a Metaclass instance for a class).

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.

I understand that there could be a difference in instance and class 
inheritance heirarchies right? But, for all practical purposes, they are the 
same. So, if this is the case, why wouldn't ProtoObject class (metaclass of 
ProtoObject) return the Metaclass instance for Class (if it's inherited from 
Class) or nil (sicne its instances inherit from nil and thus, the 
heirarchies are the same).

Let me know if you find anything...=)

>From: Dan Rozenfarb <drozenfa at yahoo.com.ar>
>Reply-To: squeak-dev at lists.squeakfoundation.org
>To: squeak-dev at lists.squeakfoundation.org
>Subject: [BUG?] ProtoObject class superclass = nil
>Date: Thu, 23 May 2002 07:32:55 -0700 (PDT)
>
>Hi all,
>I was preparing the class about metaclasses for our
>students, which tend to be scared about such issues,
>when I got scared myself.
>Much to my surprise, ProtoObject class superclass
>returns nil.  I was expecting it to return Class, but
>nope.  Am I wrong?
>For further checking, I tried Class inspect and
>obtained an inspector over Class class, which is fine.
>  Then I looked at subclasses of it, and it DOES
>contain ProtoObject class among them.
>Is this a bug?
>
>I have tried it on 2.8, several 3.2 versions and in
>3.0 (which is the one that we recommend to our
>students).
>
>Regards,
>Dan Rozenfarb
>
>__________________________________________________
>Do You Yahoo!?
>LAUNCH - Your Yahoo! Music Experience
>http://launch.yahoo.com


_________________________________________________________________
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