Assign values to places.
Arguments and values
|place|| A form which is suitable for use as a
generalized reference or |
|primary-value||The first value returned by evaluating form|
The primary value returned by form.
The form is evaluated, and each place is assigned to the corresponding value returned by form. If
nil is used one or more
places, no assignment is made to the
nil “place,” but the
corresponding value is consumed (ignored). If there are more places
than values returned,
nil is assigned to the extra places. If there
are more values than places, the extra values are discarded.
> (setf *x* (cons 0 0)) (0 . 0) > (multiple-value-setf ((car *x*) (cdr *x*)) (values 1 2 3)) 1 > *x* (1 . 2) > (multiple-value-setf (nil nil (cdr *x*)) (values -1 -2 -3)) -1 > *x* (1 . -3) > (multiple-value-setf ((car *x*) (cdr *x*)) 100) 100 > *x* (100) > (multiple-value-setf ((car *x*) (cdr *x*)) nil) nil > *x* (nil) >
The GBBopen Project