guile-devel
[Top][All Lists]
Advanced

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

Re: Procedure proposal: call-with-escape-procedure


From: Miroslav Silovic
Subject: Re: Procedure proposal: call-with-escape-procedure
Date: 07 Mar 2001 13:56:21 +0100

Marius Vollmer <address@hidden> writes:

> Miroslav Silovic <address@hidden> writes:
> 
> > Marius Vollmer <address@hidden> writes:
> > 
> > > The important thing here is that continuations created by call/cc do
> > > not run the escape handlers established by escape-protect.
> > 
> > What about a normal exit from escape-protect? You don't know whether
> > you're coming back, and if escape-protect is (for example) supposed to
> > close a file, it should run.
> 
> Hmm, I'm not sure if I understand you completely.  Are you saying that
> call/ec and escape-protect are not necessary and one could just do
> something like this instead?

Something like this:

(let ((object-you-have-to-clean-up (make-the-object)))
   (call-with-escaping-continuation
      (lambda () 0) ; do nothing
      (lambda () (destroy object-you-have-to-clean-up))))

Once the first thunk completes, should the second thunk execute? If
not, that's, IMHO, VERY counterintuitive (since every form of
unwind-protect I've seen executes the cleanup thunk on a normal
exit). If yes, well, the first thunk could've saved some reenty point
and then call-with-escaping-continuation will bomb once it reenters.

-- 
How to eff the ineffable?



reply via email to

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