[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
two questions about standard-class
Date: Tue, 12 Apr 88 11:58 EDT
From: Sonya E. Keene <skeene@STONY-BROOK.SCRC.Symbolics.COM>
A class is considered initialized if its direct superclasses are known.
I don't understand this; how can a class be defined without stating what
its direct superclasses are?
I was also confused about class-default-direct-superclasses. I
understand what it is supposed to do (the method for standard-class
ensures that standard-object is included in the CPL). The
documentation (page 3-14 on my draft) says if there are any supplied
superclasses, this method returns the list of supplied superclasses and
doesn't add standard-object to that list. If there are no supplied
superclasses, this method returns a list containing standard object.
The goal of this approach seems to be not to require standard-object to
be a direct superclass of each class (otherwise the method would always
add standard-object to the list). The assumption seems to be that if
there is a supplied superclass, it already has standard-object in its
CPL. Does this really work? What if you define a class and specify
T to be the only direct superclass?
Well, you can't do that with defclass, anyway, since Chapter 1 states
that you can't use defclass to define subclasses of a built-in class,
and t is a built-in class. However, I don't know whether you can do
the same thing some other way, using the MOP. (later... the 3rd
paragraph below makes me think there is a way)
I'm having trouble understanding some of the ramifications of T being a
built-in class. It seems strange that you can't specify T as a
superclass in the defclass form, yet you get T automatically as a
superclass (by virtue of it being a superclass of standard-object).
The MOP states that standard-object is a standard-class. This implies
that there must be some way to define a standard-class (eg
standard-object) and include a built-in class (eg t) as a superclass.
This mechanism must be different than the normal make-instance of
standard-class, because that calls valid-superclass-p, which signals an
error if the metaclass of the superclass is not EQ with the class being
defined. Or else the method for valid-superclass-p should make an
exception for the class T.
[Whatever the answer to the question, if I stated the goal of the
approach correctly, it should probably be written down in the
documentation.]