Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here's how I understand this passage. At least it makes sense to me, so I may claim understanding it :)</p> <p>I think that what it is trying to say is that the <code>(values ...)</code> form must be compatible with the arguments lambda list of the function, which, if called from <code>multiple-value-call</code> would have received these arguments correctly.</p> <p>In other words, suppose there are two functions: <code>f</code> and <code>g</code>. <code>f</code> returns values: <code>(integer &amp;rest more-integers)</code> - in human language: it can return one ore more integers. Then, if you want to call <code>(multiple-value-call #'g (f))</code> you must (you is a compiler, actually) make sure that the signature of <code>g</code> is <code>(ftype (function (integer &amp;rest more-integers) t))</code>. The return type of <code>g</code> doesn't matter.</p> <p>Here's my attempt at making an example illustrating it:</p> <pre><code>CL-USER&gt; (declaim (ftype (function () (values integer &amp;rest more-integers)) f)) ; No value CL-USER&gt; (defun f () (values 1 2)) F CL-USER&gt; (declaim (ftype (function (integer &amp;rest more-integers) t) g)) ; No value CL-USER&gt; (defun g (x &amp;rest rest) (reduce #'+ rest :initial-value x)) G CL-USER&gt; (multiple-value-call #'g (f)) 3 CL-USER&gt; (declaim (ftype (function (single-float) t) x)) ; No value CL-USER&gt; (defun x (y) y) X CL-USER&gt; (multiple-value-call #'g (x 1.5)) ; Evaluation aborted on #&lt;TYPE-ERROR expected-type: INTEGER datum: 1.5&gt;. </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload