continuationstyle
Continuationstyle, sometimes written as continuation style, is a term used in programming to describe a style of constructing computations in which the future of the computation—the continuation—is made explicit. In this approach, functions do not return values in the usual sense. Instead, they take an extra argument, the continuation, which represents the rest of the computation and is invoked with the function’s result. This makes control flow a first-class entity that can be created, stored, passed around, and composed.
The concept is most closely associated with continuation-passing style (CPS). CPS is a formalization in which
Example (very small): in direct style, a function f(x) might return x + 1. In CPS, f(x, k)
Applications and considerations: continuationstyle is a core technique in compiler design, program analysis, and language design.
Related concepts include continuation-passing style, call-with-current-continuation (call/cc), and defunctionalization.