- (cond ((null vars)
- ;; The ANSI spec says that the primary value of VALUE-FORM must be
- ;; returned. The general-case-handling code below doesn't do this
- ;; correctly in the special case when there are no vars bound, so we
- ;; handle this special case separately here.
- (let ((g (gensym)))
- `(multiple-value-bind (,g) ,value-form
- ,g)))
- ((list-of-symbols-p vars)
- (let ((temps (make-gensym-list (length vars))))
- `(multiple-value-bind ,temps ,value-form
- ,@(mapcar (lambda (var temp)
- `(setq ,var ,temp))
- vars temps)
- ,(car temps))))
- (t (error "Vars is not a list of symbols: ~S" vars))))
+ (unless (list-of-symbols-p vars)
+ (error "Vars is not a list of symbols: ~S" vars))
+ `(values (setf (values ,@vars) ,value-form)))