Peculiar behaviour of Behavior>>allSubclasses

Ralph E. Johnson johnson at cs.uiuc.edu
Wed Jun 10 13:34:22 UTC 1998


At 9:20 AM 6/10/98, Martin Pammer wrote:
>Hello squeakers
>
>I have stumbled accross a peculiar problem:
>
>Stream allSubclasses returns a Set of all Subclasses without Metaclasses.
>
>If I send allSubclasses to Object, Behavior, Class the I get all Classes in
>the System and all Metaclasses.

The metaclass of Object is a subclass of Class.  So, if you ask Class
(or ClassDescription, or Behavior, or Object) for all its subclasses,
you get all the Metaclasses, as well.

It is right and proper for "Object class" to be a subclass of Class,
because Object "is a class", i.e. it is either an instance of Class
or an instance of a subclass of Class.  It is not an instance of
Class, therefore it must be an instance of a subclass of Class.
Therefore its class (which is a metaclass) is a subclass of Class.

-Ralph





More information about the Squeak-dev mailing list