Closures/Value capture: Difference between revisions
m
→Delimited Continuations: Close code tag again.
m (→Delimited Continuations: Close code tag.) |
m (→Delimited Continuations: Close code tag again.) |
||
Line 1,418:
49</pre>
The <code>suspend</code> operator suspends the execution of the <code>sqr</code> block, causing it to return the function <code>(op f nil)</code>. The variable <code>f</code> represents the captured continuation as a function. Continuation functions take one mandatory argument. We don't need that here, hence the <code>(op f nil)</code> expression is returned: it curries the one arg continuation function <code>f</code> to a function with no arguments.
The loop pushes these suspended continuations into a list, and then <code>nreverse</code>-s it.
|