Re: [j-devel] Re: Question about REGISTER-JAVA-EXCEPTION

On Sun, 30 Oct 2005, Peter Graves wrote:
> On Sun, 30 Oct 2005 at 11:49:46 +0100, Andras Simon wrote:
>> In the meantime I changed all the other Java calling functions, not
>> just JNEW, to use the new scheme. And there are a few related tests
>> in tests/java-tests.lisp.
>
> Thanks for doing the tests!
>
> I moved WITH-REGISTERED-EXCEPTION from test-utilities.lisp to java-
> tests.lisp and #+abcl'ed it, since Allegro runs java-tests.lisp too.
>
> ABCL's cross-implementation test suite is very new, and I haven't
> really got the infrastructure 100% nailed down yet, but in general,
> things should only go in test-utilities.lisp if they're used by tests
> in all (or at least most) of the tested areas.
>
> Helper functions and macros that are used in only one of the test files
> should just go in that particular test file.
I'll try to remember (and adhere to) this!
> By the way, I like the idea of WITH-REGISTERED-EXCEPTION, and if we
> keep going in this direction, we should probably just put it in
> java.lisp.
>
> Or should it be WITH-REGISTERED-EXCEPTIONS, allowing you to specify
> multiple registrations at once:
>
> (with-registered-exceptions
> (("java.lang.Throwable" 'throwable)
> ("java.lang.NullPointerException 'null-pointer-exception))
> (do-something))
If something like it ever gets in java.lisp, it should definitely take
this form. But I don't see any general use for it. Do you? If it also
saved and restored the previous state, that would seem more useful, but
I'm afraid it'd also be a step in the direction we agreed not to go...
Andras