X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fpcl%2Fmethods.lisp;h=9bf5e04747cb26cc0945fcc9de21f13ad838f8b9;hb=cf0b72cd4052a09b9a305081524bd44e2948c1e5;hp=c395c7bab7f35cdffbc0683b1cca7a9cdf48ae98;hpb=09702467ab16baab34dc209606d9d07af38eaedd;p=sbcl.git diff --git a/src/pcl/methods.lisp b/src/pcl/methods.lisp index c395c7b..9bf5e04 100644 --- a/src/pcl/methods.lisp +++ b/src/pcl/methods.lisp @@ -229,7 +229,7 @@ (let* ((existing-gf (find-generic-function generic-function-name nil)) (generic-function (if existing-gf - (ensure-generic-function + (ensure-generic-function generic-function-name :generic-function-class (class-of existing-gf)) (ensure-generic-function generic-function-name))) @@ -610,7 +610,7 @@ )) (defmethod same-specializer-p ((specl1 specializer) (specl2 specializer)) - nil) + (eql specl1 specl2)) (defmethod same-specializer-p ((specl1 class) (specl2 class)) (eq specl1 specl2)) @@ -629,6 +629,24 @@ (defmethod specializer-class ((specializer eql-specializer)) (class-of (slot-value specializer 'object))) +;;; KLUDGE: this is needed to allow for user-defined specializers in +;;; RAISE-METATYPE; however, the list of methods is maintained by +;;; hand, which is error-prone. We can't just add a method to +;;; SPECIALIZER-CLASS, or at least not with confidence, as that +;;; function is used elsewhere in PCL. `STANDARD' here is used in the +;;; sense of `comes with PCL' rather than `blessed by the +;;; authorities'. -- CSR, 2007-05-10 +(defmethod standard-specializer-p ((specializer class)) t) +(defmethod standard-specializer-p ((specializer eql-specializer)) t) +(defmethod standard-specializer-p ((specializer class-eq-specializer)) t) +(defmethod standard-specializer-p ((specializer class-prototype-specializer)) + t) +(defmethod standard-specializer-p ((specializer specializer)) nil) + +(defun specializer-class-or-nil (specializer) + (and (standard-specializer-p specializer) + (specializer-class specializer))) + (defun error-need-at-least-n-args (function n) (error 'simple-program-error :format-control "~@