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,61e9062c1f23b9d5 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!newsfeed.freenet.de!newsfeed0.kamp.net!newsfeed.kamp.net!news.osn.de!diablo2.news.osn.de!news.belwue.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: contracted exceptions 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: <1181165630.012508.55290@i38g2000prf.googlegroups.com> <19fxsxv1god43$.1pqq8vgfu2itn$.dlg@40tude.net> Date: Fri, 8 Jun 2007 09:39:45 +0200 Message-ID: NNTP-Posting-Date: 08 Jun 2007 09:37:15 CEST NNTP-Posting-Host: d6e22d3c.newsspool1.arcor-online.net X-Trace: DXC=CFQTdc84HeeFXUDVUnEXQmic==]BZ:afn4Fo<]lROoRaFl8W>\BH3Yb5>=EAGYI@jaDNcfSJ;bb[eFCTGGVUmh?dLK[5LiR>kgb?mS[d]HUC@h X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:16098 Date: 2007-06-08T09:37:15+02:00 List-Id: On Thu, 7 Jun 2007 21:19:08 -0500, Randy Brukardt wrote: > It is certainly true that in some cases (such as a public library like Claw) > you really do want to document all of the exceptions propagated (*and > why!*), and some compiler enforcement might be nice. But even there, it > would seem that such contracts would get in the way of debugging (if a > violated exception contract caused Program_Error to be raised, the original, > unexpected exception and its information would be lost, and that would make > debugging harder. I'd rather know about a Constraint_Error due to a null > access value being dereferenced than an exception contract being > violated...). Shouldn't "contracted exceptions" actually mean statically contracted ones? IMO, a contract can be violated only by the [buggy] compiler. > Anyway, it would seem that real Preconditions and Invariants would be more > useful (the rest of the original thread this was split from seems mainly to > be about a rather weak from of preconditions). I think it is a different thing, provided, you meant preconditions checked at run-time. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de