ANSI Common Lisp 5 Data and Control Flow 5.3 Dictionary of Data and Control Flow
- Arguments and Values:
n - a non-negative integer; evaluated.
form - a form; evaluated as described below.
object - an object.
Evaluates n and then form,
returning as its only value the nth value yielded by form,
or nil if n is greater than or equal to the number of values
returned by form. (The first returned value is numbered 0.)
(nth-value 0 (values 'a 'b)) A
(nth-value 1 (values 'a 'b)) B
(nth-value 2 (values 'a 'b)) NIL
(let* ((x 83927472397238947423879243432432432)
(a (nth-value 1 (floor x y)))
(b (mod x y)))
(values a b (= a b)))
3332987528, 3332987528, true
- See Also:
Operationally, the following relationship is true, although nth-value
might be more efficient in some implementations
because, for example, some consing might be avoided.
(nth-value n form) ==(nth n (multiple-value-list form))
- Allegro CL Implementation Details: