[slime-cvs] CVS slime

mkoeppe mkoeppe at common-lisp.net
Tue Mar 28 20:41:53 UTC 2006


Update of /project/slime/cvsroot/slime
In directory clnet:/tmp/cvs-serv1641

Modified Files:
	swank.lisp 
Log Message:
(multiple-value-or): New macro.
(extra-keywords): Use MULTIPLE-VALUE-OR rather than OR.


--- /project/slime/cvsroot/slime/swank.lisp	2006/03/28 00:41:41	1.374
+++ /project/slime/cvsroot/slime/swank.lisp	2006/03/28 20:41:53	1.375
@@ -1799,36 +1799,47 @@
                           allow-other-keys-p
                           (list class-name-form)))))))))))
 
+(defmacro multiple-value-or (&rest forms)
+  (if (null forms)
+      nil
+      (let ((first (first forms))
+            (rest (rest forms)))
+        `(let* ((values (multiple-value-list ,first))
+                (primary-value (first values)))
+          (if primary-value
+              (values-list values)
+              (multiple-value-or , at rest))))))
+
 (defmethod extra-keywords ((operator (eql 'make-instance))
                            &rest args)
-  (or (apply #'extra-keywords/make-instance operator args)
-      (call-next-method)))
+  (multiple-value-or (apply #'extra-keywords/make-instance operator args)
+                     (call-next-method)))
 
 (defmethod extra-keywords ((operator (eql 'make-condition))
                            &rest args)
-  (or (apply #'extra-keywords/make-instance operator args)
-      (call-next-method)))
+  (multiple-value-or (apply #'extra-keywords/make-instance operator args)
+                     (call-next-method)))
 
 (defmethod extra-keywords ((operator (eql 'error))
                            &rest args)
-  (or (apply #'extra-keywords/make-instance operator args)
-      (call-next-method)))
+  (multiple-value-or (apply #'extra-keywords/make-instance operator args)
+                     (call-next-method)))
 
 (defmethod extra-keywords ((operator (eql 'signal))
                            &rest args)
-  (or (apply #'extra-keywords/make-instance operator args)
-      (call-next-method)))
+  (multiple-value-or (apply #'extra-keywords/make-instance operator args)
+                     (call-next-method)))
 
 (defmethod extra-keywords ((operator (eql 'warn))
                            &rest args)
-  (or (apply #'extra-keywords/make-instance operator args)
-      (call-next-method)))
+  (multiple-value-or (apply #'extra-keywords/make-instance operator args)
+                     (call-next-method)))
 
 (defmethod extra-keywords ((operator (eql 'cerror))
                            &rest args)
-  (or (apply #'extra-keywords/make-instance operator
-             (cdr args))
-      (call-next-method)))
+  (multiple-value-or (apply #'extra-keywords/make-instance operator
+                            (cdr args))
+                     (call-next-method)))
 
 (defun enrich-decoded-arglist-with-extra-keywords (decoded-arglist form)
   "Determine extra keywords from the function call FORM, and modify




More information about the slime-cvs mailing list