mop: fix bug in compute-applicable-methods-using-classes

Move computation of args-specializers from #'sort-applicable-methods up
to #'std-compute-applicable-methods. Fix suggested by @costanza.
Fixes #203.
This commit is contained in:
Daniel Kochmański 2016-01-04 20:40:37 +01:00
parent 491ec2fbf0
commit 7898553d6a

View file

@ -221,7 +221,9 @@
;;; 3. Subclasses of specified classes preserve the slot order in ECL.
;;;
(defun std-compute-applicable-methods (gf args)
(sort-applicable-methods gf (applicable-method-list gf args) args))
(sort-applicable-methods gf
(applicable-method-list gf args)
(mapcar #'class-of args)))
(setf (fdefinition 'compute-applicable-methods) #'std-compute-applicable-methods)
@ -264,11 +266,10 @@
classes)
t))))
(defun sort-applicable-methods (gf applicable-list args)
(defun sort-applicable-methods (gf applicable-list args-specializers)
(declare (optimize (safety 0) (speed 3)))
(with-early-accessors (+standard-method-slots+ +standard-generic-function-slots+)
(let ((f (generic-function-a-p-o-function gf))
(args-specializers (mapcar #'class-of args)))
(let ((f (generic-function-a-p-o-function gf)))
;; reorder args to match the precedence order
(when f
(setf args-specializers