From: Bruno Haible <bruno@cl...>  20040802 11:44:39

Standard methodcombination appears to ignore an overridden computeapplicablemethods function, if one of the methods is an :AROUND method. SBCL 0.8.11. Here are two test cases: ;; Check that it's possible to change the order of applicable methods from ;; mostspecificfirst to mostspecificlast. (progn (defclass mslgenericfunction (standardgenericfunction) () (:metaclass sbpcl:funcallablestandardclass)) (defun reversemethodlist (methods) (let ((result '())) (dolist (method methods) (if (and (consp result) (equal (methodqualifiers method) (methodqualifiers (caar result)))) (push method (car result)) (push (list method) result))) (reduce #'append result))) (defmethod sbpcl:computeapplicablemethods ((gf mslgenericfunction) arguments) (reversemethodlist (callnextmethod))) (defmethod sbpcl:computeapplicablemethodsusingclasses ((gf mslgenericfunction) classes) (reversemethodlist (callnextmethod))) (defgeneric testgf07 (x) (:genericfunctionclass mslgenericfunction) (:method ((x integer)) (cons 'integer (if (nextmethodp) (callnextmethod)))) (:method ((x real)) (cons 'real (if (nextmethodp) (callnextmethod)))) (:method ((x number)) (cons 'number (if (nextmethodp) (callnextmethod)))) (:method :around ((x integer)) (coerce (callnextmethod) 'vector))) (list (testgf07 5.0) (testgf07 17))) Expected: ((number real) #(number real integer)) Got: ((number real) #(integer real number)) ;; Check that it's possible to filterout applicable methods. (progn (defclass nonumbergenericfunction (standardgenericfunction) () (:metaclass sbpcl:funcallablestandardclass)) (defun nonumbermethodlist (methods) (removeif #'(lambda (method) (member (findclass 'number) (sbpcl:methodspecializers method))) methods)) (defmethod sbpcl:computeapplicablemethods ((gf nonumbergenericfunction) arguments) (nonumbermethodlist (callnextmethod))) (defmethod sbpcl:computeapplicablemethodsusingclasses ((gf nonumbergenericfunction) classes) (nonumbermethodlist (callnextmethod))) (defgeneric testgf08 (x) (:genericfunctionclass nonumbergenericfunction) (:method ((x integer)) (cons 'integer (if (nextmethodp) (callnextmethod)))) (:method ((x real)) (cons 'real (if (nextmethodp) (callnextmethod)))) (:method ((x number)) (cons 'number (if (nextmethodp) (callnextmethod)))) (:method :around ((x integer)) (coerce (callnextmethod) 'vector))) (list (testgf08 5.0) (testgf08 17))) Expected: ((real) #(integer real)) Got: ((real) #(integer real number)) Bruno 