Message from discussion Implementing call/cc or Dynamic Continuations in ANSI CL
X-Mailer: Mozilla 4.79 [en] (X11; U; Linux 2.4.18-4GB i686)
Subject: Re: Implementing call/cc or Dynamic Continuations in ANSI CL
References: <email@example.com> <firstname.lastname@example.org> <3E9EFD0E.email@example.com> <firstname.lastname@example.org>
Content-Type: text/plain; charset=us-ascii
Date: Thu, 17 Apr 2003 23:55:05 GMT
X-Trace: typhoon.sonic.net 1050623705 126.96.36.199 (Thu, 17 Apr 2003 16:55:05 PDT)
NNTP-Posting-Date: Thu, 17 Apr 2003 16:55:05 PDT
Joe Marshall wrote:
> b...@sonic.net writes:
> > Really? You can store continuations in data structures and
> > call them multiple times, even after returning from the
> > context once or more?
> I'm not exactly sure how Will is interpreting the original poster's
> question, but if he is interpreting `dynamic continuations' as meaning
> `continuations with dynamic extent', then it *is* trivial to implement
> in CL (hint, close over a lexical block), but you would not be able to
> invoke them more than once because of the dynamic extent.
Ah. Darn. Doing binary manipulation to compose datagrams in
portable (R5RS) scheme is like kicking dead whales down the beach.
Think, slow, ugly, disgusting, smelly, and requiring far more
effort than is reasonable. Most implementations provide binary
operations that are efficient, so you have fast binary ops in
any given implementation, but code depending on them won't be
portable. I had to detect the implementation and conditionally
define a bunch of macros in R5RS-compatible language to do
things the REALLY SLOW way.
But continuations of the type provided by scheme's call/cc (ie,
which you can call more than once and can call after returning
from the context once or more) make recovering from protocol
errors, a serious pain in most languages, totally trivial.
If I could have had schemish call/cc-like continuations with
CL's standard binary operations, that would have been really neat.
Hmmm. I don't know exactly what "dynamic" means in the context
of continuations. My mind grabbed onto the "like call/cc" part
of the question. But if we're talking about extent, "like
call/cc" isn't dynamic extent, it's unlimited extent. Is a
"dynamic continuation" one with dynamic extent?