Next: , Previous: , Up: iklib coroutines   [Index]


6.11.2 Basic coroutine operations

Function: coroutine thunk

Create a new coroutine having thunk as function and enter it; return unspecified values.

Function: yield

Register the current continuation as coroutine, then run the next coroutine; return unspecified values.

Function: finish-coroutines
Function: finish-coroutines exit-loop?

Loop running the next coroutine until there are no more; return unspecified values.

When the argument exit-loop? is used: it must be a thunk. Before entering the next coroutine exit-loop? is called: if it returns non-false the loop exits, if it returns #f the loop continues.