[Larceny-users] ERR5RS Error Conditions

William D Clinger will at ccs.neu.edu
Fri Feb 22 23:35:02 EST 2008


Ray Racine wrote:
> What is the ERR5RS behavior of the following code snippet?

ERR5RS does not specify the R6RS exception semantics,
so the behavior of that code snippet is officially
unspecified.

> ie, should I have expected to have caught the exception??

Yes.  For Larceny's ERR5RS mode, I tried to implement
a compromise semantics that's compatible with Larceny's
R5RS semantics when no R6RS-style exception handlers
have been installed, but is intended to have R6RS-style
behavior when one or more R6RS-style exception handlers
have been installed.  That doesn't appear to be working
as intended, and I don't yet understand why.

I'll file a bug report for this after I have tried a few
more things.

On the other hand, the R6RS mode appears to be working
as intended:

Error: no handler for exception #<record &compound-condition>
Compound condition has these components:
#<record &error>
#<record &who>
    who : raise
#<record &message>
    message : "handler returned"
#<record &irritants>
    irritants : (#<PROCEDURE> #<record &compound-condition>)

Terminating program execution.

To avoid that error in R6RS mode, the handler should
not return, e.g.

(call/cc
 (lambda (return)
  (with-exception-handler (lambda (h) (return #t))
                          (lambda () (die)))))

Will



More information about the Larceny-users mailing list