User Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

cl:special_operators:multiple-value-call [2017/05/01 21:00] (current)
Line 1: Line 1:
 +====== Special Operator MULTIPLE-VALUE-CALL ======
 +
 +====Syntax====
 +  * multiple-value-call //​function-form form''​*''//​ → //​result''​*''//​
 +
 +====Arguments and Values====
 +  * //​function-form//​ - a //​[[CL:​Glossary:​form]]//;​ evaluated to produce //​function//​.
 +  * //​function//​ - a //​[[CL:​Glossary:​function designator]]//​ resulting from the evaluation of //​function-form//​.
 +  * //form// - a //​[[CL:​Glossary:​form]]//​.
 +  * //results// - the //​[[CL:​Glossary:​value|values]]//​ returned by the //​function//​.
 +
 +====Description====
 +Applies //​function//​ to a //​[[CL:​Glossary:​list]]//​ of the //​[[CL:​Glossary:​object|objects]]//​ collected from groups of //​[[CL:​Glossary:​multiple values]]//.
 +
 +**multiple-value-call** first evaluates the //​function-form//​ to obtain //​function//,​ and then evaluates each //form//. All the values of each //form// are gathered together (not just one value from each) and given as arguments to the //​function//​.
 +
 +====Examples====
 +<​blockquote>​
 +(multiple-value-call #'list 1 '/ (values 2 3) '/ (values) '/ (floor 2.5)) 
 +<r>(1 / 2 3 / / 2 0.5) </r>
 +(+ (floor 5 3) (floor 19 4)) ; ≡ (+ 1 4) 
 +<r>5 </r>
 +(multiple-value-call #'+ (floor 5 3) (floor 19 4)) ; ≡ (+ 1 2 4 3)
 +<​r>​10</​r>​
 +</​blockquote>​
 +
 +====Affected By====
 +None.
 +
 +====Exceptional Situations====
 +None.
 +
 +====See Also====
 +  * **[[CL:​Macros:​multiple-value-list|Macro MULTIPLE-VALUE-LIST]]**
 +  * **[[CL:​Macros:​multiple-value-bind|Macro MULTIPLE-VALUE-BIND]]**
 +
 +====Notes====
 +None.
 +