From c53007d8f1795dd75be80219c753c27f24f1b2f3 Mon Sep 17 00:00:00 2001
From: rtoy <rtoy>
Date: Tue, 18 May 2004 13:43:08 +0000
Subject: [PATCH] From Juan Jose Garcia Ripoll:

    but the following gives wrong results:

    (macroexpand '(multiple-value-bind (&rest x) (foo y) d))

    (MULTIPLE-VALUE-CALL

       #'(LAMBDA (&OPTIONAL &REST X &REST #:G858) (DECLARE (IGNORE #:G858)) D)

      (FOO Y))

Fix from Juan Jose Garcia Ripoll.
---
 code/macros.lisp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/code/macros.lisp b/code/macros.lisp
index b2e7f0666..a6634a43e 100644
--- a/code/macros.lisp
+++ b/code/macros.lisp
@@ -5,7 +5,7 @@
 ;;; Carnegie Mellon University, and has been placed in the public domain.
 ;;;
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/macros.lisp,v 1.99 2004/05/06 14:36:47 rtoy Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/macros.lisp,v 1.100 2004/05/18 13:43:08 rtoy Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -543,18 +543,18 @@
 ;;;
 (defmacro multiple-value-setq (varlist value-form)
   (unless (and (listp varlist) (every #'symbolp varlist))
-    (error "Varlist is not a list of symbols: ~S." varlist))
+    (simple-program-error "Varlist is not a list of symbols: ~S." varlist))
   `(values (setf (values ,@varlist) ,value-form)))
 
 ;;;
 (defmacro multiple-value-bind (varlist value-form &body body)
   (unless (and (listp varlist) (every #'symbolp varlist))
-    (error "Varlist is not a list of symbols: ~S." varlist))
+    (simple-program-error  "Varlist is not a list of symbols: ~S." varlist))
   (if (= (length varlist) 1)
       `(let ((,(car varlist) ,value-form))
 	 ,@body)
       (let ((ignore (gensym)))
-	`(multiple-value-call #'(lambda (&optional ,@varlist &rest ,ignore)
+	`(multiple-value-call #'(lambda (&optional ,@(mapcar #'list varlist) &rest ,ignore)
 				  (declare (ignore ,ignore))
 				  ,@body)
 	   ,value-form))))
-- 
GitLab