Fri Aug 28 14:49:55 CEST 2009

Partial Continuations

From the bit-twiddler's perspective, a partial continuation is not
much more than a segment of the call stack represented as a function,
where the full continuation is the whole call stack, represented as a
``function that doesn't return''.

The nuances come from how you specify the marking that enables you
to isolate the a segment between the current point and the one marked,
and how you execute code in the continuation that remains when this
segment is removed.

From [3]: ``The operators shift, control, control0, shift0 are the
   members of a single parameterized family, and the standard CPS is
   sufficient to express their denotational semantics.''

According to Oleg in [3], ``Shift to Control''[4] is the one to read.
This paper is about CPS transforms, and not directly of interest to me
atm.  I'm already quite happy with an understanding of how to
implement it dynamically.  Anyways, the gang of 4:

  +F+  shift
  +F-  control
  -F+  shift0
  -F-  control0

Here eFk denotes whether the shifted expression will be run inside a
delimited context e=+ or not e=- and whether the continuation will be
delemited k=+ or not k=-.

[1] http://okmij.org/ftp/Computation/Continuations.html#generic-control
[2] http://lambda-the-ultimate.org/node/966
[3] http://lambda-the-ultimate.org/node/606
[4] http://www.cs.rutgers.edu/~ccshan/recur/recur.pdf
[5] http://docs.plt-scheme.org/reference/cont.html