The docstring clearly says that we take the candidate whose direct
subclass is rightmost in the SO-FAR list, but the code searches SO-FAR
from the left and takes the first match. As far as I can make out, this
has always been wrong: the earliest version of `merge-lists' builds the
output list in order, and the earliest version of `clos-tiebreaker'
searched from the left anyway.
Just reverse the list before scanning.
direct subclass then that subclass's direct superclasses list must order
them relative to each other."
direct subclass then that subclass's direct superclasses list must order
them relative to each other."
+ (dolist (class (reverse so-far))
(dolist (candidate candidates)
(when (member candidate (sod-class-direct-superclasses class))
(return-from clos-tiebreaker candidate))))
(dolist (candidate candidates)
(when (member candidate (sod-class-direct-superclasses class))
(return-from clos-tiebreaker candidate))))