A class can have more than one superclass. With single inheritance (one superclass), it's easy to order the superclasses from most to least specific. This is the rule:
(defclass a (b c) ...)
Class A
is more specific than B
or C
(for instances of
A
), but what if
something (an :INITFORM
, or a method) is specified by
B
and C
? Which
overrides the other? The rule in CLOS
is that the superclasses listed
earlier are more specific than those listed later. So:
CLOS
has an algorithm for breaking ties. This ensures
that all implementations always produce the same order, but it's
usually considered a bad idea for programmers to rely on exactly
what the order is. If the order for some superclasses is important,
it can be expressed directly in the class definition.