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: FW: Kawa and BSF


> Any user of eval is reading, possibly compiling, and executing some
> arbitrary JVM program.  For that activity, *any* throwable may relate
> directly.  It is an inherently dangerous activity.  Forcing a
> programmer
> to catch or declare something won't make this particular activity any
> safer.

Now this is a good point.  But it doesn't change the fact that a user may
want to do something about a syntax error, but not want to bother with
catching runtimes such as NPE's as there's normally nothing to be done for
them except fall over.

> OTOH, if you want Kawa to define subclasses of RuntimeException and
> throw those so that you can be more specific about what you catch
> without forcing the rest of us to declare another throwable, ask Per.
> Maybe he'd do it or be willing to incorporate a patch from you.

It doesn't really matter so much for what I'm doing, as BSF has to catch all
exceptions, and throw checked ones in turn, so that it at least provides a
robust user interface in the normal java style.

I'm not really interested in becoming a crusader for exceptions either, as I
know there are problems with the model.  My point is just that Kawa doesn't
use exceptions as they were intended, and as users expect them to be used.

I found this surprising and potentially inconvenient, and so will other
users.  So in the interests of Kawa receiving as wide an uptake as possible,
I'd suggest toeing the exception line, at least in the user interface
classes.  But this is just a personal opinion, and as I said, it hasn't
really mattered in what I'm doing, so if the Kawa contributors find things
so convenient the way they are, then que sirrah etc.


> -----Original Message-----
> From: kawa-owner@sources.redhat.com
> [mailto:kawa-owner@sources.redhat.com]On Behalf Of
> brlewis@alum.mit.edu
> Sent: 10 May 2001 17:11
> To: Allan Erskine
> Cc: 'Per Bothner'; 'Kawa (E-mail)'
> Subject: Re: FW: Kawa and BSF
>
>
> Allan Erskine <a.erskine@cs.ucl.ac.uk> writes:
>
> > You definitely do not expect a user to catch all
> throwables, as the user is
> > generally not in a position to be able to do anything about
> most throwables
> > (such as ArrayOutOfBounds).  The only throwables a user may
> be able to
> > constructively act upon are those that relate directly to
> the activity they
> > are engaged in.  If something goes wrong with the way they
> are using Kawa
> > they expect a Kawa exception.  Surely....
>
> Any user of eval is reading, possibly compiling, and executing some
> arbitrary JVM program.  For that activity, *any* throwable may relate
> directly.  It is an inherently dangerous activity.  Forcing a
> programmer
> to catch or declare something won't make this particular activity any
> safer.
>
> OTOH, if you want Kawa to define subclasses of RuntimeException and
> throw those so that you can be more specific about what you catch
> without forcing the rest of us to declare another throwable, ask Per.
> Maybe he'd do it or be willing to incorporate a patch from you.
>
>
> --
> Bruce R. Lewis
http://brl.sourceforge.net/


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