ifcc ( capture restore -- obj )
Factor handbook » The language » Continuations

Next:callcc0 ( quot -- )


Vocabulary
continuations

Inputs
capturea quotation with stack effect ( continuation -- initial )
restorea quotation with stack effect ( obj -- obj' )


Outputs
objan object provided when resuming the continuation or initial


Word description
Reifies a continuation from the point immediately after which this word would return, and passes it to capture. Every time the continuation is resumed using continue-with and a new obj , restore is called first with obj on the stack, and then execution continues. If capture returns, execution continues with initial on the stack.

See also
callcc0, continue, callcc1, continue-with

Definition