![[LISPWORKS]](/image.pl?url=http%3a%2f%2fwww.lispworks.com%2fdocumentation%2fHyperSpec%2fBody%2f..%2fGraphics%2fLWSmall.gif&f=jpg&w=240)
![[Common Lisp HyperSpec (TM)]](/image.pl?url=http%3a%2f%2fwww.lispworks.com%2fdocumentation%2fHyperSpec%2fBody%2f..%2fGraphics%2fCLHS_Sm.gif&f=jpg&w=240)
Ordinarily the result of calling afunction is a singleobject. Sometimes, however, it is convenient for a function to compute severalobjects and return them.
In order to receive other than exactly one value from aform, one of severalspecial forms ormacros must be used to request those values. If aform producesmultiple values which were not requested in this way, then the first value is given to the caller and all others are discarded; if theform produces zero values, then the caller receivesnil as a value.
The next figure lists someoperators for receivingmultiple values[2]. Theseoperators can be used to specify one or moreforms toevaluate and where to put thevalues returned by thoseforms.
multiple-value-bindmultiple-value-prog1return-frommultiple-value-callmultiple-value-setqthrowmultiple-value-listreturn
Figure 3-5. Some operators applicable to receiving multiple values
Thefunctionvalues can producemultiple values[2].(values) returns zero values;(valuesform) returns theprimary value returned byform;(valuesform1form2) returns two values, theprimary value ofform1 and theprimary value ofform2; and so on.
Seemultiple-values-limit andvalues-list.