Brief Guide to CLOS: Multiple inheritance

## 5. Multiple inheritance

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:

- Rule 1: Each class is more specific than its superclasses. In multiple inheritance this is harder. Suppose we have `(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:
- Rule 2: For a given class, superclasses listed earlier are more specific than those listed later. These rules are used to compute a linear order for a class and all its superclasses, from most specific to least specific. This order is the "class precedence list" of the class. The two rules are not always enough to determine a unique order, however, 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.