Subject: Re: Continuation Passing Style
From: (Rob Warnock)
Date: 1997/12/10
Newsgroups: comp.lang.scheme
Message-ID: <66lcm4$>

Gerald Smith  <70363.2333@CompuServe.COM> wrote:
| Does anyone know if there are any other uses of CPS other than 
| creating interpreters/compilers... I am using the book "Essentials
| of Programming Languages" as my tutorial.

Look at the summary at the end of Chapter 9, where they point out that
by reifying continuations as data structures, you can [sometimes] use
them even in languages or environments that don't support them natively,
e.g., to add coroutines or "threads" to C or assembler code.

Or, it may just put an interesting light on something else, e.g., one
can view an interrupt as as a non-deterministic forced invocation of a
continuation (which may or may not be transformable into a "subroutine
call", depending on the nature of the interrupt)...

| My main motivation is in trying to "improve" the use of continuations
| in Common Lisp. Presently, I am using Paul Graham's macros.

I suspect that at a minimum you'll come away from reading EoPL with a
significantly improved understanding of Graham's CL macros. Not that
you'll necessarily find that *satisfying*, since using continuations
in an environment that doesn't support them natively will probably
always be a bit clunky...


Rob Warnock, 7L-551
Silicon Graphics, Inc.		Phone: 650-933-1673 [New area code!]
2011 N. Shoreline Blvd.		FAX: 650-933-4392
Mountain View, CA  94043	PP-ASEL-IA