/[cmucl]/src/code/macros.lisp
ViewVC logotype

Diff of /src/code/macros.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.98.2.1 by rtoy, Thu May 6 13:53:41 2004 UTC revision 1.98.2.2 by rtoy, Tue May 18 14:36:56 2004 UTC
# Line 543  Line 543 
543  ;;;  ;;;
544  (defmacro multiple-value-setq (varlist value-form)  (defmacro multiple-value-setq (varlist value-form)
545    (unless (and (listp varlist) (every #'symbolp varlist))    (unless (and (listp varlist) (every #'symbolp varlist))
546      (error "Varlist is not a list of symbols: ~S." varlist))      (simple-program-error "Varlist is not a list of symbols: ~S." varlist))
547    `(values (setf (values ,@varlist) ,value-form)))    `(values (setf (values ,@varlist) ,value-form)))
548    
549  ;;;  ;;;
550  (defmacro multiple-value-bind (varlist value-form &body body)  (defmacro multiple-value-bind (varlist value-form &body body)
551    (unless (and (listp varlist) (every #'symbolp varlist))    (unless (and (listp varlist) (every #'symbolp varlist))
552      (error "Varlist is not a list of symbols: ~S." varlist))      (simple-program-error  "Varlist is not a list of symbols: ~S." varlist))
553    (if (= (length varlist) 1)    (if (= (length varlist) 1)
554        `(let ((,(car varlist) ,value-form))        `(let ((,(car varlist) ,value-form))
555           ,@body)           ,@body)
556        (let ((ignore (gensym)))        (let ((ignore (gensym)))
557          `(multiple-value-call #'(lambda (&optional ,@varlist &rest ,ignore)          `(multiple-value-call #'(lambda (&optional ,@(mapcar #'list varlist) &rest ,ignore)
558                                    (declare (ignore ,ignore))                                    (declare (ignore ,ignore))
559                                    ,@body)                                    ,@body)
560             ,value-form))))             ,value-form))))

Legend:
Removed from v.1.98.2.1  
changed lines
  Added in v.1.98.2.2

  ViewVC Help
Powered by ViewVC 1.1.5