guile-devel
[Top][All Lists]
Advanced

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

Re: continuation efficiency


From: Thomas Bushnell, BSG
Subject: Re: continuation efficiency
Date: 08 Jul 2001 12:23:12 -0700
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

Marius Vollmer <address@hidden> writes:

> Yes, but the point of escape-protect is not to prevent entering the
> dynamic context more than once, it is about preventing it to be
> entered once you have promised that this wont happen in the future.
> The promise is made by invoking a escape continuation.

Um, I can make that promise (in the *right* way, IMO) by using an
entry thunk in dynamic-wind.  

> Thus, the error checking is there to enforce the defined semantics of
> escape-protect.  Part of that semantics is that there is a distinction
> between switching from one dynamic context to another with the
> intention to switch back later (as for coroutines), and leaving a
> dynamic context with the promise not to come back (as for non-local
> aborts in reaction to an error).

It is certainly true that continuations are useful for coroutines.
But that's *not* all they are, and thinking of them as a "coroutine
semantic" is going to stunt the analysis.  

> The former non-local transfers of control are the job of call/cc and
> the switching of dynamic contexts can be observed and implemented with
> dynamic-wind.  The latter is the job of call/ec and can be observed
> with escape-protect.

The whole thing is the job of call/cc.  I'm becoming more and more
convinced that call/ec is a serious mistake...




reply via email to

[Prev in Thread] Current Thread [Next in Thread]