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:

>As for implementation, I understand that in Java, the exceptions would
>need to be declared. Is this also required by the JVM? In other words, if
>method M throws a gnu.text.SyntaxException, say, but its translation into 
>JVM doesn't declare this, is it then invalid JVM code?
>
The JVM (and the verifier, I believe) ignores "throws" specification.
The problem is Java code that implements or calls Scheme code.
For example PrimProcedure's applyV method does not have a throws
clause, so it cannot throw checked exceptions.

The orgin Kawa used throws clauses, but it was clumsy, so I threw
them out.  However, it occurred to me that it might be reasonable
to just say that all "apply" and similar methods (such as "eval")
could be just declared to throw Exception (or perhaps just Throwable).
Then we wouldn't need wrappers.  This could be consistent with an
future extension that allows you to specify a throws clause for a Scheme
procedure - if you don't specify one, the default is 'throws Exceptions'

However, this is a rather drastic change, and would need more thought
and experimentation..



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