X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fpcl%2Fdefcombin.lisp;h=060f4a0cd0b907bd5839f41752bec352bd09c7c4;hb=b86f43bae31f775d834c724e21f0f573b968f695;hp=13781e5884e0f6859d869a8e7cc3d5a4b231666e;hpb=72f8804f1a2ea98cfccdd7972b299cc309c55279;p=sbcl.git diff --git a/src/pcl/defcombin.lisp b/src/pcl/defcombin.lisp index 13781e5..060f4a0 100644 --- a/src/pcl/defcombin.lisp +++ b/src/pcl/defcombin.lisp @@ -25,10 +25,13 @@ (defmacro define-method-combination (&whole form &rest args) (declare (ignore args)) - (if (and (cddr form) - (listp (caddr form))) - (expand-long-defcombin form) - (expand-short-defcombin form))) + `(progn + (with-single-package-locked-error + (:symbol ',(second form) "defining ~A as a method combination")) + ,(if (and (cddr form) + (listp (caddr form))) + (expand-long-defcombin form) + (expand-short-defcombin form)))) ;;;; standard method combination @@ -298,6 +301,12 @@ ;; parse-method-group-specifiers parse the method-group-specifiers +(define-condition long-method-combination-error + (reference-condition simple-error) + () + (:default-initargs + :references (list '(:ansi-cl :macro define-method-combination)))) + (defun wrap-method-group-specifier-bindings (method-group-specifiers declarations real-body) (let (names @@ -316,16 +325,19 @@ (if (and (equal ,specializer-cache .specializers.) (not (null .specializers.))) (return-from .long-method-combination-function. - '(error "More than one method of type ~S ~ - with the same specializers." - ',name)) + '(error 'long-method-combination-error + :format-control "More than one method of type ~S ~ + with the same specializers." + :format-arguments (list ',name))) (setq ,specializer-cache .specializers.)) (push .method. ,name)) cond-clauses) (when required (push `(when (null ,name) (return-from .long-method-combination-function. - '(error "No ~S methods." ',name))) + '(error 'long-method-combination-error + :format-control "No ~S methods." + :format-arguments (list ',name)))) required-checks)) (loop (unless (and (constantp order) (neq order (setq order (eval order))))