Comment 3 for bug 1332983

Revision history for this message
Alastair Bridgewater (alastair-bridgewater) wrote :

Some further digging shows that Issue METACLASS-OF-SYSTEM-CLASS:UNSPECIFIED removed a restriction that all classes corresponding to predefined type specifiers (thus, including T) must be a STANDARD-CLASS, a STRUCTURE-CLASS, or a BUILT-IN-CLASS.

If we go with the "DEFCLASS may not create a class in which any of the superclasses is a BUILT-IN-CLASS" argument then T must be either a STANDARD-CLASS or a STRUCTURE-CLASS. If T is a STANDARD-CLASS then its direct instances are STANDARD-OBJECTs, including such cases as INTEGERs. Similar logic applies to STRUCTURE-CLASS and STRUCTURE-OBJECTs. This way lies silliness.

My interpretation, for what it's worth given that I'm not particularly well versed in the more esoteric uses and implementation of CLOS, is that the restriction on subclassing BUILT-IN-CLASS is intended for direct subclassing using DEFCLASS, and that the implementation is permitted (possibly required) to create STANDARD-OBJECT and STRUCTURE-OBJECT as direct subclasses of T, but users are not granted mechanism to create direct subclasses of BUILT-IN-CLASS and thus all of the user-defined classes must derive from STANDARD-OBJECT or STRUCTURE-OBJECT.

We then return to AMOP, having justified having T as a BUILT-IN-CLASS, and realize that VALIDATE-SUPERCLASS is applied over the full CPL, including T itself, hence the requirement that it return T in such situations.