n boileaudespréaux  Continuation-passing style  In functional
programming, continuation-passing style is a style of
programming in which control is passed explicitly in the form of
a continuation.   Instead of "returning" values as in the more
familiar direct style, a function written in continuation-
passing style (CPS) takes an explicit continuation argument
which is meant to receive the result of the computation
performed within the function. When a subroutine is invoked
within a CPS function, the calling function is required to
supply a procedure to be invoked with the subroutine's "return"
value. Expressing code in this form makes a number of things
explicit which are implicit in direct style. These include:
procedure returns, which become apparent as calls to a
continuation; intermediate values, which are all given names;
order of argument evaluation, which is made explicit; and tail
recursion, which is simply calling a procedure with the
continuation that was passed to the caller.  Programs can be
autom