From b045196ca0fcb1d72d2d6b1c4eabcc76df13e034 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sat, 7 Jul 2018 14:41:55 +0100 Subject: [PATCH] src/class-finalize-impl.lisp (clos-tiebreaker): Search from the right end. 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. --- src/class-finalize-impl.lisp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/class-finalize-impl.lisp b/src/class-finalize-impl.lisp index 6401318..b92b604 100644 --- a/src/class-finalize-impl.lisp +++ b/src/class-finalize-impl.lisp @@ -123,7 +123,7 @@ direct subclass then that subclass's direct superclasses list must order them relative to each other." - (dolist (class so-far) + (dolist (class (reverse so-far)) (dolist (candidate candidates) (when (member candidate (sod-class-direct-superclasses class)) (return-from clos-tiebreaker candidate)))) -- 2.11.0