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,7d3cb5920e882220 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!news.teledata-fn.de!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Contracted exceptions for Ada 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: <5947aa62-2547-4fbb-bc46-1111b4a0dcc9@x69g2000hsx.googlegroups.com> <7m9wkymyi5h7.1235e72is9mp9.dlg@40tude.net> Date: Sun, 9 Dec 2007 12:02:48 +0100 Message-ID: <12dud1fg1b0s5.137rtqpvn9f15.dlg@40tude.net> NNTP-Posting-Date: 09 Dec 2007 12:02:50 CET NNTP-Posting-Host: 65bc9491.newsspool1.arcor-online.net X-Trace: DXC=V;ob?5BQ64]@>[RYkFXOIPic==]BZ:af^4Fo<]lROoRQ4nDHegD_]RUkLU__ZK7gFVDNcfSJ;bb[UIRnRBaCd On Sun, 09 Dec 2007 05:22:44 -0500, Stephen Leake wrote: > "Dmitry A. Kazakov" writes: > >> On Fri, 7 Dec 2007 21:30:05 -0600, Randy Brukardt wrote: >> >>> Another one is what to do if a contract is violated. The obvious answer of >>> raising Program_Error doesn't do anything other than lose information about >>> an exception, so that isn't very satisfying. >> >> Yes, in my view exception contracts have to be static. > > The only way to statically enforce exception contracts is to use SPARK > Ada (http://www.praxis-his.com/sparkada/). SPARK Ada does do exactly > that (among other things); it also signficantly restricts the Ada > language to a manageable subset. (I doubt that limitations of SPARK are caused by contracted exceptions. It just does right what Ada didn't.) > So if you like exception contracts, use SPARK Ada. > > If you like all the things SPARK Ada leaves out (I don't have the > current list handy; it doesn't seem to be on the web site), use > standard Ada. This does not answer the questions, which are two: 1. Are contracted exceptions any good? (If they are not then SPARK isn't as well) 2. Can Ada have them? (If not then why SPARK does?) -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de