X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fpcl%2Fmethods.lisp;h=9bf5e04747cb26cc0945fcc9de21f13ad838f8b9;hb=cf0b72cd4052a09b9a305081524bd44e2948c1e5;hp=d0e5c0484b3bf1f583e3bde17b6462d2cdf0c8d8;hpb=d984db0864aa7ba5155ec684462840ec1a49ca5b;p=sbcl.git diff --git a/src/pcl/methods.lisp b/src/pcl/methods.lisp index d0e5c04..9bf5e04 100644 --- a/src/pcl/methods.lisp +++ b/src/pcl/methods.lisp @@ -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 "~@