Convert guile exceptions to R6RS conditions in R6RS exception handlers.
authorMark H Weaver <mhw@netris.org>
Fri, 9 Aug 2013 22:27:20 +0000 (18:27 -0400)
committerMark H Weaver <mhw@netris.org>
Mon, 18 Nov 2013 05:35:42 +0000 (00:35 -0500)
commit02500d44775a77e46febfd47a0dab8233b0c99d0
tree44d7817c371d9d8f0aa83f501e1b967bb13adcc3
parent750ac8c592e792e627444f476877f282525b132e
Convert guile exceptions to R6RS conditions in R6RS exception handlers.

* module/rnrs/exceptions.scm (&guile): New condition type.

  (guile-condition-converters): New variable.

  (convert-guile-condition, default-guile-condition-converter,
  set-guile-condition-converter!, guile-common-conditions,
  guile-lexical-violation-converter, guile-syntax-violation-converter,
  guile-assertion-violation-converter, guile-system-error-converter,
  guile-undefined-violation-converter, guile-error-converter,
  guile-implementation-restriction-converter): New procedures.

  (with-exception-handler): Catch all exceptions, not just R6RS
  exceptions.  Convert native Guile exceptions to R6RS conditions,
  preserving the original Guile exception information in the &guile
  condition object.

  (raise): If the condition includes a &guile condition, use 'throw' to
  throw the original native guile exception instead of raising an R6RS
  exception.

* test-suite/tests/r6rs-exceptions.test ("guile condition conversions"):
  Add tests.
module/rnrs/exceptions.scm
test-suite/tests/r6rs-exceptions.test