The Avail Programming Language

Continuation

An entity which crystallizes the entire execution state of the running thread (the stack, program counter, etc.) for later use. The parameter types and return types of the continuation match the corresponding types of the block in which it is defined.

Continuations can be exited or resumed. When a continuation is exited, the program execution state is replaced with the contents of the continuation, and the most recently entered block (the top block on the continuation's stored stack) is exited with the supplied return value (if any). When a continuation is resumed, the program execution state is replaced with the contents of the continuation, and the next statement in line is executed. Both the exit and resume instructions are of return type , since continuations do not "return".

Grammar: VARNAME : $[PARAMTYPES] > RETURNTYPE := REFERENCE;

References: An in-depth look at continuations