8.7.2 Sorting Methods
Now, with the idea of the class precedence list, we can state precisely
how the possible methods are sorted when more than one of the methods of
a generic function are applicable to the call arguments.
The rules are that
- the applicable methods are sorted in order of specificity, and the most
specific method is used first, then the next if that method calls
next-method
, and so on
- a method M1 is more specific than another method M2 if the first
specializing class that differs, between the definitions of M1 and M2,
is more specific, in M1’s definition, for the corresponding actual call
argument, than the specializing class in M2’s definition
- a class C1 is more specific than another class C2, for an object of
actual class C, if C1 comes before C2 in C’s class precedence list.