0.7.9.18:
authorChristophe Rhodes <csr21@cam.ac.uk>
Wed, 30 Oct 2002 16:20:00 +0000 (16:20 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Wed, 30 Oct 2002 16:20:00 +0000 (16:20 +0000)
DEFINE-METHOD-COMBINATION should return the name of the method
combination, not some method.  Make it so.

src/pcl/defcombin.lisp
tests/clos.impure.lisp
version.lisp-expr

index 97472ca..56d0759 100644 (file)
@@ -98,7 +98,8 @@
            :definition-source `((define-method-combination ,type) ,pathname)))
     (when old-method
       (remove-method #'find-method-combination old-method))
-    (add-method #'find-method-combination new-method)))
+    (add-method #'find-method-combination new-method)
+    type))
 
 (defun short-combine-methods (type options operator ioa method doc)
   (cond ((null options) (setq options '(:most-specific-first)))
                                  ,*load-pathname*))))
     (setf (gethash type *long-method-combination-functions*) function)
     (when old-method (remove-method #'find-method-combination old-method))
-    (add-method #'find-method-combination new-method)))
+    (add-method #'find-method-combination new-method)
+    type))
 
 (defmethod compute-effective-method ((generic-function generic-function)
                                     (combin long-method-combination)
index b4462cd..cad0723 100644 (file)
           k)
 
 (dmc-test-mc :k 1)
+;;; While I'm at it, DEFINE-METHOD-COMBINATION is defined to return
+;;; the NAME argument, not some random method object. So:
+(assert (eq (define-method-combination dmc-test-return-foo)
+           'dmc-test-return-foo))
+(assert (eq (define-method-combination dmc-test-return-bar :operator and)
+           'dmc-test-return-bar))
+(assert (eq (define-method-combination dmc-test-return
+               (&optional (order :most-specific-first))
+             ((around (:around))
+              (primary (dmc-test-return) :order order :required t))
+             (let ((form (if (rest primary)
+                             `(and ,@(mapcar #'(lambda (method)
+                                                 `(call-method ,method))
+                                             primary))
+                             `(call-method ,(first primary)))))
+               (if around
+                   `(call-method ,(first around)
+                     (,@(rest around)
+                      (make-method ,form)))
+                   form)))
+           'dmc-test-return))
 \f
 ;;;; success
 
index 4308737..4c8916b 100644 (file)
@@ -18,4 +18,4 @@
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
 
-"0.7.9.17"
+"0.7.9.18"