[racket] continuation barrier in raise

From: Keiko Nakata (keiko at kurims.kyoto-u.ac.jp)
Date: Wed Jan 5 09:55:38 EST 2011

> A `with-handlers' handler and a `call-with-exception-handler' handler
> are invoked with different continuations. A `with-handlers' handler is
> invoked with the continuation of the entire `with-handlers'
> expression; a `call-with-exception-handler' handler is invoked with
> the continuation of the `raise' call. In this example, the barrier is
> gone by the time the `with-handlers' handler runs.

Ah! I now have a shorter example:

(call-with-exception-handler 
 (lambda (_) (control f 10)) 
 (lambda () (raise 4))) 

Is it possible to observe this behavior 
without 'call-with-exception-handler' 
(and without other internal definitions such as 'exception-handler-key')?
I am guessing it could be via other control operators.

> I only discovered this subtlety myself about a week ago, 

Indeed 'call-with-exception-handler' does not appear a very common
construct in the sense that I do not find it in OCaml or Java.
But it looks handy. 

Thanks, 
Keiko


Posted on the users mailing list.