[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Abstracting continuations



I am trying to improve my understanding of continuations
from the point of view of programming language design
rather than implementation, i.e. what sort of syntax is
necessary to give programmers the power to express
continuations, regardless of how it's implemented.  Most
of the descriptions here have been framed in terms of 
taking a snapshot of certain aspects of program state.  
This strikes me as insufficiently abstract.

What I would like is a less empirical and more stateless
description.  How might you define a continuation in the
abstract, without having to run the program to a certain
point to capture its state?  It's clearly more than a
location in the program, since the bindings and return
addresses depend also on how the program got to that
location.

Since my background is more commercial than academic (a
Ferengi rather than a Vulcan, for those relying on the
Star Trek pedagogical model), my personal experience
with syntax for continuations is limited -- throw/catch,
setjmp/longjmp, GOTO's, etc.  In these special cases,
additional state information is unnecessary.  With
throw/catch, you're not jumping to a new call stack, 
just unwinding it a bit, so all the needed state 
information is already there.  Are there any comparably 
simple syntactic structures around for handling more 
general kinds of continuations that allow a programmer to
abstractly define rather than capture a continuation? 

Michael

-----------------------------
Michael St. Hippolyte
http://www.bentodev.org