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,7d3cb5920e882220 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!nuzba.szn.dk!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Exceptions Date: Mon, 10 Dec 2007 20:18:24 -0600 Organization: Jacob's private Usenet server Message-ID: References: <5947aa62-2547-4fbb-bc46-1111b4a0dcc9@x69g2000hsx.googlegroups.com> <475c6ed8$0$13111$9b4e6d93@newsspool2.arcor-online.net> <1kxk3hlfa25dw$.fl2wvbn0tpbg$.dlg@40tude.net> <475d04ea$0$13113$9b4e6d93@newsspool2.arcor-online.net> <194zh0rz03487$.6vxhavjdbpdr.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: jacob-sparre.dk 1197339288 32064 69.95.181.76 (11 Dec 2007 02:14:48 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 11 Dec 2007 02:14:48 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1914 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1914 Xref: g2news1.google.com comp.lang.ada:18886 Date: 2007-12-10T20:18:24-06:00 List-Id: "Dmitry A. Kazakov" wrote in message news:194zh0rz03487$.6vxhavjdbpdr.dlg@40tude.net... ... > No, only in absence of a contract. Consider: > > function Foo return ... is > begin > if ... then > return ...; > end if; > end Foo; > > This is illegal because of the contract to return a value. I hope you do > not propose to make Foo legal because required "else" would spoil so nicely > formatted code? (:-)) Actually, this is perfectly legal because there is a value returned, and Ada doesn't require any sort of path analysis (it is impossible in the general case). It does raise Program_Error, but that is very different. Especially since you are talking about static contracts... Randy.