comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Forcing Exception Handling
Date: Mon, 28 Feb 2011 21:54:08 -0600
Date: 2011-02-28T21:54:08-06:00	[thread overview]
Message-ID: <ikhql1$807$1@munin.nbi.dk> (raw)
In-Reply-To: 87y64zucco.fsf@ludovic-brenta.org

"Ludovic Brenta" <ludovic@ludovic-brenta.org> 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.







  reply	other threads:[~2011-03-01  3:54 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-28 17:27 Forcing Exception Handling iloAda
2011-02-28 17:32 ` Simon Clubley
2011-02-28 18:33   ` onox
2011-02-28 19:10     ` Simon Clubley
2011-02-28 18:34   ` Vinzent Hoefler
2011-02-28 20:20 ` Florian Weimer
2011-02-28 20:35 ` Ludovic Brenta
2011-03-01  3:54   ` Randy Brukardt [this message]
2011-03-01  8:34     ` Dmitry A. Kazakov
2011-03-02  0:00       ` Randy Brukardt
2011-03-02  8:28         ` Dmitry A. Kazakov
2011-02-28 20:38 ` Georg Bauhaus
2011-03-01  0:19   ` Shark8
2011-03-01  8:56     ` Dmitry A. Kazakov
2011-03-01  9:34       ` iloAda
2011-03-01  9:47         ` Vinzent Hoefler
2011-03-01  9:51         ` Dmitry A. Kazakov
2011-03-01 10:07           ` iloAda
2011-03-01 13:27         ` Mark Lorenzen
2011-03-01 16:11         ` J-P. Rosen
2011-03-02  0:11         ` Randy Brukardt
2011-03-01 15:23       ` Shark8
2011-03-01 15:44         ` Dmitry A. Kazakov
2011-03-02  0:02       ` Randy Brukardt
2011-03-01  2:08 ` Hoàng Đình Long
2011-03-02 13:39 ` ytomino
replies disabled

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