Subject: Re: Trouble with CALL/CC
From: (Rob Warnock)
Date: 1997/01/30
Newsgroups: comp.lang.scheme
Message-ID: <5cpcet$>

Chris Bitmead <> wrote:
| Does lisp have something equivilent to call/cc?

Not *exactly* equivalent to full Scheme call/cc, no. But...

1. For "escaping" continuations (using call/cc like C "setjmp/longjmp"),
   CL has several forms: block_label/return, catch/throw, unwind-protect.

2. For emulating a small subset of the "restarting" or "rerunning"
   capabilities of call/cc, see Paul Graham's book "On Lisp", where he
   shows how to write CL macros that give you enough to do, for example,
   non-deterministic searching, or data "generators", etc.

But in general, to get *full* call/cc you'd have to (automatically, one
hopes, with a preprocessor step) rewrite (potentially) your entire CL source
program and all the libraries in "continuation-passing style" (CPS). Not
something to contemplate lightly...


Rob Warnock, 7L-551
Silicon Graphics, Inc.
2011 N. Shoreline Blvd.		Phone: 415-933-1673  FAX: 415-933-0979
Mountain View, CA  94043	PP-ASEL-IA