I got a problem with class precedence. I will simplify the problem
for clarity. Consider the following class definitions:
(define-class <A> () ())
(define-class <B> (<A>) ())
(define-class <C> (<A>) ())
(define-class <D> (<B>) ())
(define-class <E> (<C>) ())
(define-class <F> (<D> <E>) ())
The class precedence list of <F> resulting of a call to
class-precedence-list gives the following: (<F> <D> <E> <B> <A> <C>).
I believe this brakes the first rule of class precedence given in the
reference manual p. 87: "Each class is more specific than its
superclasses." Obviously, <C> is more specific than <A>, but it
appears later.
Is it a well-known problem of class precedence in STklos or CLOS? I
must admit I'm new to this kind of problems.
I can see two solutions that don't really satisfy me. The first one
is <B> not to inherit from <A>. The second is to explicitly specify
the class precedence list of <F>: (define-class <F> (<D> <E> <B> <C>)
()) or (define-class <F> (<D> <E> <B> <C> <A>) ()). Do other
solutions exist? Maybe I should modify the class-precedence-list
procedure?
,
Anthony BEURIVE
LaBRI (Univ. Bordeaux I)
351, cours de la Liberation
33405 Talence, FRANCE
mailto:beurive_at_labri.u-bordeaux.fr
Received on Tue Oct 12 1999 - 16:12:30 CEST
This archive was generated by hypermail 2.3.0
: Mon Jul 21 2014 - 19:38:59 CEST