Skip to content
Snippets Groups Projects
Commit c53007d8 authored by rtoy's avatar rtoy
Browse files

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.
parent a002ef9e
No related branches found
No related tags found
No related merge requests found
......@@ -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))))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment