This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: primitive-throw wraps all exceptions (was: Kawa wraps Java exceptions unexpectedly)


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]