Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Implementing call/cc or Dynamic Continuations in ANSI CL

Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!nntp.cs.ubc.ca!nntp-relay.ihug.net!ihug.co.nz!news-out.nuthinbutnews.com!propagator2-sterling!in.nntp.be!feed.news.sonic.net!typhoon.sonic.net!not-for-mail
Message-ID: <3E9F3E99.5EE41AAB@sonic.net>
From: b...@sonic.net
Organization: ...disorganized...
X-Mailer: Mozilla 4.79 [en] (X11; U; Linux 2.4.18-4GB i686)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.lang.lisp,comp.lang.scheme
Subject: Re: Implementing call/cc or Dynamic Continuations in ANSI CL
References: <b3b6b110.0304121624.1bec15d9@posting.google.com> <b84e9a9f.0304170924.6c280db6@posting.google.com> <3E9EFD0E.2664576@sonic.net> <r8809aej.fsf@ccs.neu.edu>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 39
Date: Thu, 17 Apr 2003 23:55:05 GMT
NNTP-Posting-Host: 209.204.181.162
X-Complaints-To: abuse@sonic.net
X-Trace: typhoon.sonic.net 1050623705 209.204.181.162 (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?

			Bear