[plt-scheme] 359.3

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Thu Jan 4 07:28:23 EST 2007

MzScheme and MrEd are now version 369.3 in the SVN repository trunk.

The changes are mostly bug fixes (especially related to 359.2 changes).

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:

 (raise 10)
 ; => uncaught exception: 10

 (call-with-exception-handler
  (lambda (exn) (+ exn 3))
  (lambda () (raise 10)))
 ; => uncaught exception: 13

"Previous" means the handler for the continuation starting after the
frame associated with the called handler.

Beware that `call-with-exception-handler' calls its thunk argument in
tail position, so the handler that looks like it might be "previous"
actually gets replaced:

 (call-with-exception-handler
  (lambda (exn) (+ exn 30))
  (lambda ()
   (call-with-exception-handler 
    (lambda (exn) (+ exn 3))
    (lambda () (raise 10)))))
 ; => uncaught exception: 13

 (call-with-exception-handler
  (lambda (exn) (+ exn 30))
  (lambda ()
   (list (call-with-exception-handler 
          (lambda (exn) (+ exn 3))
          (lambda () (raise 10))))))
 ; => uncaught exception: 43

Meanwhile, with delimited continuations, the previous handler might be
a different one than the one available when
`call-with-exception-handler' was evaluated:

 (define k
   (call-with-continuation-prompt
    (lambda ()
      (call-with-exception-handler
       (lambda (exn) (+ exn 3))
       (lambda ()
         ((call-with-composable-continuation
           (lambda (k)
             (lambda () k)))))))))
 (k (lambda () (raise 12)))
 ; => uncaught exception: 15

 (call-with-exception-handler
  (lambda (exn) (+ exn 2))
  (lambda ()
    (list (k (lambda () (raise 12))))))
 ; => uncaught exception: 17


Matthew



Posted on the users mailing list.