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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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!news1.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!fu-berlin.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Forcing Exception Handling Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <02901b13-da72-48ae-9cb3-bf1a10144c44@u3g2000vbe.googlegroups.com> <87y64zucco.fsf@ludovic-brenta.org> <3es12u7g6ppm.4lk5iya2a586.dlg@40tude.net> Date: Wed, 2 Mar 2011 09:28:55 +0100 Message-ID: NNTP-Posting-Date: 02 Mar 2011 09:28:55 CET NNTP-Posting-Host: 36b88040.newsspool1.arcor-online.net X-Trace: DXC=aTUM_Rh=\\fFXUDVUnEXQmic==]BZ:afn4Fo<]lROoRa<`=YMgDjhgb[OgT3@U=9bn[6LHn;2LCVn7enW;^6ZC`d\`mfM[68DCc7_l1?4^9]?h X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:18683 Date: 2011-03-02T09:28:55+01:00 List-Id: On Tue, 1 Mar 2011 18:00:32 -0600, Randy Brukardt wrote: > "Dmitry A. Kazakov" wrote in message > news:3es12u7g6ppm.4lk5iya2a586.dlg@40tude.net... >> On Mon, 28 Feb 2011 21:54:08 -0600, Randy Brukardt wrote: > ... >>> 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. >> >> Unless Storage_Error and Program_Error made manageable contracted >> exceptions would have only limited use. > > I agree; I think that if we go this way all exceptions would have to appear > in the contract. To make that managable, we'd also need a way to define a > "set" of exceptions so they could be referred to together. I personally > think that is sufficient, and it would let the compiler tell you what it > knows about exceptions being raised. I thought about sort of conditional exceptions. E.g. storage error possibly raised when stack has less than n storage units. The compiler should estimate n in the cases mandated by the ARM. In other cases (recursion etc) the program is illegal, but the programmer may specify n explicitly using a pragma (he must know what he's doing, of course). Another example of conditional exception would be "I don't raise, if you don't." And we need a mechanism of exception propagation from slave tasks to their masters (when the task's exception contract is not null). -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de