comp.lang.ada
 help / color / mirror / Atom feed
From: fraser@sinopsis.com (Fraser Wilson)
Subject: Re: A small Ada success story
Date: 1999/03/19
Date: 1999-03-19T00:00:00+00:00	[thread overview]
Message-ID: <921866918.613.55@news.remarQ.com> (raw)
In-Reply-To: 7crpn2$kt6@drn.newsguy.com

paene lacrimavi postquam bill@newsguy.com scribavit:

>Java does all that out of the box. I found Ada exception tracing to be weak
>compared to Java more powerfull exceptions. In Java, an exception is an object,
>that contains very usefull info that one can use.

I often wondered about an extension to the exception declaration syntax:

    Error : exception with record Exception_Type : Natural;  end record;

(Not that I'd ever use a Natural in this way of course!)

Mind you, Ada 95 gives you messages and stuff.

I think the problem with attaching a bunch of arbitrary information to an
exception is that the exception itself is supposed to be, well, exceptional.
Furthermore, if you read the Quality and Style guide, you'll notice that
it suggests providing query functions that can be used to prevent an
exception from being raised; e.g. for array-based stacks, a function
Stack_Is_Full.

Given all that, what would all this extra info buy you, apart from a
temptation to use exceptions as flow control?  In any case, you can always
query the package that raised the exception to find out what went wrong.

I fear I sound like one of the "Ada does it this way; therefore it must
be correct" zealots.  Oh, well.

Fraser.
(change i's to y's for my real email address)




  reply	other threads:[~1999-03-19  0:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-03-14  0:00 A small Ada success story Steffen Huber
1999-03-17  0:00 ` Nick Roberts
1999-03-17  0:00 ` Tom Moran
1999-03-17  0:00   ` dennison
1999-03-18  0:00     ` Corey Ashford
1999-03-18  0:00       ` bill
1999-03-19  0:00         ` Fraser Wilson [this message]
1999-03-21  0:00           ` Ehud Lamm
1999-03-21  0:00             ` robert_dewar
1999-03-21  0:00               ` Tom Moran
1999-03-21  0:00                 ` robert_dewar
1999-03-22  0:00               ` Simon Wright
1999-03-19  0:00         ` Larry Kilgallen
1999-03-20  0:00         ` locating exceptions (Ada vs. Java) Markus Kuhn
1999-03-20  0:00           ` bill
1999-03-19  0:00       ` A small Ada success story dewar
1999-03-18  0:00     ` locating exceptions (was: Ada success story) Markus Kuhn
1999-03-19  0:00     ` A small Ada success story Michael F Brenner
1999-03-26  0:00       ` Steve Quinlan
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox