[BUG]?? Problem sending allSubclasses to Object

Allen Wirfs-Brock Allen_Wirfs-Brock at Instantiations.com
Fri Apr 9 21:31:39 UTC 1999


At 11:16 AM 4/9/99 PDT, Carl Gundel wrote:
>Aha!  I didn't notice that Object>>allSubclasses returns both classes 
>AND metaclasses.  It does this in VisualWorks and Squeak.  
>VisualSmalltalk on the other hand, does behave as I thought (returns 
>like kind, either class or metaclass).  Of course I realize that 
>MetaClasses are subclassed from Object.  Personally I prefer the 
>VisualSmalltalk behavior because it lets me easily get classes and 
>metaclasses independently, or both.
>
>I wonder if the ANSI standard defines behavior for this.
>

5.3.8 Protocol: <classDescription>
Conforms To
<Object>
Description
This protocol describes the behavior of *class objects*. It provides
messages for identifying and locating *class objects* within the class
hierarchy.

....

5.3.8.1 Message:	allSubclasses
Synopsis
Return all subclasses of a class.
Definition: <classDescription>
If the receiver is a *class object*, return a collection containing all of
the *class objects* whose *class definitions* inherit either directly or
indirectly from the *class definition* of the receiver.
If the receiver is not a *class object*, the result is unspecified.
Each element of the result collection supports the protocol
<classDescription>. The order of *class objects* within the collection is
unspecified.
<collection>	unspecified
Errors
none

(*asterisk bracketed* expressions have precise definitions in the
standard's glossary)

Allen_Wirfs-Brock at Instantiations.com





More information about the Squeak-dev mailing list