This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Re: primitive-throw wraps all exceptions (was: Kawa wraps Java exceptions unexpectedly)
- To: Jocelyn Paine <popx at pop3 dot ifs dot org dot uk>
- Subject: Re: primitive-throw wraps all exceptions (was: Kawa wraps Java exceptions unexpectedly)
- From: Per Bothner <per at bothner dot com>
- Date: Sun, 07 Oct 2001 23:41:26 -0700
- CC: kawa at sourceware dot cygnus dot com
- References: <Pine.LNX.4.10.10110071707390.1388-100000@pop3.ifs.org.uk>
Jocelyn Paine wrote:
>I see that the method kawa.standard.prim_throw.throw_it wraps its argument
>in a runtimeException unless it already is one or an Error, so clearly
>this wrapping is intended. Are the handlers supposed to unwrap so that the
>exception matches the type but failing to do so? Help!
>
Some wrapping is needed for checked exceptions since Scheme doesn't have any
such concept, and it would not be reasonable to require that exceptions be
statically declared in a dynamically typed language. However, PrimProcedure
should wrap the IOException in a WrappedException, not a RuntimeException.
Then we have the options of later unwrapping.
Whether handlers should unwrap is more difficult to say.
It would be appealing to allow Scheme functions to *options* declare
which (checked) exceptions they may throw, and not wrap such exceptions.
However, we'd have to think about how that would work.
--Per