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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,1a4156f047b063f X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!goblin2!goblin.stu.neva.ru!aioe.org!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Forcing Exception Handling Date: Mon, 28 Feb 2011 21:54:08 -0600 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <02901b13-da72-48ae-9cb3-bf1a10144c44@u3g2000vbe.googlegroups.com> <87y64zucco.fsf@ludovic-brenta.org> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1298951650 8199 69.95.181.76 (1 Mar 2011 03:54:10 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 1 Mar 2011 03:54:10 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5931 X-RFC2646: Format=Flowed; Original Xref: g2news2.google.com comp.lang.ada:18630 Date: 2011-02-28T21:54:08-06:00 List-Id: "Ludovic Brenta" wrote in message news:87y64zucco.fsf@ludovic-brenta.org... > iloAda writes: >> Hello everybody, >> >> I was wondering if there is a way in Ada to force exception handling. >> For instance, if there is a call to a function that may raise an >> exception, force the caller to handle that exception. >> I was wondering if there is a compile time pragma that will isntruct >> the compiler to force the handling of exceptions!! > > I think the Ada Rapporteur Group considered the idea and rejected it. I > seem to remember they had good reasons but I forgot which they were. > Maybe the first was that pretty much any statement can raise > Storage_Error, and that Program_Error can be raised during elaboration, > when there is no exception handler in place yet. I think it is more of a case of being unable to come to consensus than "rejecting" it. (Same effect, ultimately.) Some people feel that Java's version doesn't work very well in practice, leaving to too many "when Some_Exception => null" handlers rather than consideration of why the exceptions are being propagated. That seems like bad software management to me. In any case, any such "contracts" in Ada would have to be optional (for compatibility reasons), and that might actually help reduce the problems. We had such a discussion just a few weeks ago (not yet filed, so I can't point you at it), but in any case there won't be anything in Ada 2012 (we're very close to freezing that version, nothing significant can be added at this point). Randy.