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,61e9062c1f23b9d5 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit X-FeedAbuse: http://nntpfeed.proxad.net/ feeded by 88.191.28.29 Path: g2news1.google.com!news3.google.com!feeder1-2.proxad.net!212.27.60.67.MISMATCH!proxad.net!nntpfeed.proxad.net!news.netfinity.fr!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: contracted exceptions Date: Thu, 7 Jun 2007 21:19:08 -0500 Organization: Jacob's private Usenet server Message-ID: References: <1181165630.012508.55290@i38g2000prf.googlegroups.com> <19fxsxv1god43$.1pqq8vgfu2itn$.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: jacob-sparre.dk 1181269029 20409 69.95.181.76 (8 Jun 2007 02:17:09 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Fri, 8 Jun 2007 02:17:09 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1807 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 Xref: g2news1.google.com comp.lang.ada:16097 Date: 2007-06-07T21:19:08-05:00 List-Id: "Robert A Duff" wrote in message news:wccwsyfa5vf.fsf@shell01.TheWorld.com... > Ray Blaak writes: > > > "Dmitry A. Kazakov" writes: > >> I would like to see contracted exceptions... > > > > The Java experience shows that compiler checked exception > > specifications don't work. > > I don't quite agree. I'd say the Java experience shows that the exact > rules of Java don't work very well. But that does not imply that the > whole idea can't work well. > > I think Java is on the right track here, and with a few tweaks to the > rules would work quite well. I'm not as convinced. We discussed this subject in the ARG and no one had any ideas that were real improvements on the Java situation. (It's too bad that you can't come to meetings more often, because you often have a unique perspective on things.) Thus the idea was dropped. It's fairly clear that the default for Ada would have to be to let exceptions propagate (for compatibility with existing code, if for no other reason). That might actually be the rule change that fixes the Java problems, but it also would make any contracts not particularly relevant. 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...). 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). We (the ARG) worked a lot harder on those, but could never get the inheritance rules quite right. (And thus it is dropped from the Amendment for a lack of maturity.) Randy.