From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,50ad4ada98045ba X-Google-Attributes: gid103376,public From: fraser@sinopsis.com (Fraser Wilson) Subject: Re: A small Ada success story Date: 1999/03/19 Message-ID: <921866918.613.55@news.remarQ.com>#1/1 X-Deja-AN: 456586242 References: <119fb4e248%hubersn@lcs.wn.bawue.de> <7cp9cp$743$1@nnrp1.dejanews.com> <36F0A77F.B0151962@rocketmail.com> <7crpn2$kt6@drn.newsguy.com> X-Complaints-To: newsabuse@remarQ.com X-Trace: 921866918.613.55 KZBGBQC4S164892E1C usenet1.supernews.com Organization: Vegetarian Ada Programmers NNTP-Posting-Date: Fri, 19 Mar 1999 18:08:38 GMT Newsgroups: comp.lang.ada Originator: fraser@titanic Date: 1999-03-19T00:00:00+00:00 List-Id: 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)