[plt-scheme] 369.3

From: Dave Herman (dherman at ccs.neu.edu)
Date: Sat Jan 13 10:23:44 EST 2007

> One minor change is that a low-level exception handler, as installed
> with `call-with-exception-handler', can chain to the "previous" handler
> by simply returning a value:

I'm a little confused. It seems very difficult to *prevent* chaining 
when you don't want it, e.g. to implement `with-handlers'-like behavior 
(where an inner exception handler whose predicate succeeds overrides any 
outer exception handlers). I tried capturing a continuation:

     (let/cc k
         (lambda (x) (k x))
         (lambda () (raise 10))))

but that's illegal because it's performing a jump across a continuation 
barrier. (Is this the continuation barrier placed around the handler 
when it's invoked in the continuation of the `raise' expression?)

If I understand what I was doing, I think managed it with a prompt and 

       (lambda ()
           (lambda (x) (abort-current-continuation tag x))
           (lambda () (raise 10))))
       (lambda (x) x)))

AFAICT from macro-stepping, I think that's how `with-handlers' is 
implemented: install a prompt, invoke the handler, and abort to the 
prompt if the handler succeeds.

Is that right? Why is it that it's legal to abort across the 
continuation barrier but not to jump across it?


Posted on the users mailing list.