[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Comments on MOP
Hello! As probably you know we are developing an implementation of
CLOS based on the ObjVlisp model in KCL. We have two questions about
MOP. Is there a person so kind to answer?
We don't agree with your proposal for the implementation of defclass.
You specify that defclass expands to a call to the generic function
add-named-class, passing it a prototype instance of
the class specified by the :metaclass option.
We feel that the introduction of the concept of a prototype instance
is an unnecessary complication. It also invites confusion between the
new class you are creating and the metaclass which is instantiated to
make the prototype instance.
We suggest instead that the concept of metaclass is sufficient to
implement the desired behavior simply by invoking add-named-class with
the metaclass as an argument. Sometimes this approach could require the
introduction of new metaclasses just for the purpose of defining an
add-named-class method, but we don't think this is a significant
overhead. For example we had to introduce the classes
standard-metaclass and structure-metaclass just to provide the
add-named-class method used by their instances standard-class
The other question concerns the optimization of slot access. In chap.3
the generic function optimize-instance-access is described. Is it
invoked by the compiler in order to optimize instance accessing forms?
Is it correct that when optimize-instance-access is called to
optimize a slot-value form, converting it to a call of
standard-instance-access, slot-missing and slot-unbound are not
also invoked? It is not defined what is an access key. Looking at the
definition of slot-value-using-class in page 3-47 of new-mop it looks
like the access key in a call to standard-instance-access is the
slot name. Is it correct? Is the mapping from slot name to index done
by class-access-keys, which is invoked by standard-instance-access?
Thanks in advance,