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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ea5071f634c2ea8b X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Received: by 10.68.36.6 with SMTP id m6mr2531354pbj.4.1322020184707; Tue, 22 Nov 2011 19:49:44 -0800 (PST) Path: lh20ni7626pbb.0!nntp.google.com!news2.google.com!goblin1!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: Generic-Package Elaboration Question / Possible GNAT Bug. Date: Wed, 23 Nov 2011 04:49:42 +0100 Organization: Ada @ Home Message-ID: References: <7bf9bc32-850a-40c6-9ae2-5254fe220533@f29g2000yqa.googlegroups.com> <4295dc09-43de-4557-a095-fc108359f27f@y42g2000yqh.googlegroups.com> <3snehoqgs8ia$.1nobjem6g6hx6$.dlg@40tude.net> <128rdz2581345$.c4td19l7qp9z$.dlg@40tude.net> <16ipwvpdavifr$.17bxf7if7f6kh$.dlg@40tude.net> <4ecb78b1$0$6643$9b4e6d93@newsspool2.arcor-online.net> <1iofgbqznsviu$.phvidtvxlyj4$.dlg@40tude.net> <4ecbb96e$0$6581$9b4e6d93@newsspool3.arcor-online.net> NNTP-Posting-Host: wgHBtatYse3YjKAUQsirEA.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/11.60 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Xref: news2.google.com comp.lang.ada:14541 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable Date: 2011-11-23T04:49:42+01:00 List-Id: Le Tue, 22 Nov 2011 16:02:06 +0100, Georg Bauhaus = a =C3=A9crit: > [1] http://www.eiffel.com/developers/design_by_contract_in_detail.html= Oops, not good for its claims, an exemple DbC=E2=84=A2 use case in this = page is = erroneous: > it will look as follows in Eiffel syntax, as part of a genericclass = > DICTIONARY [ELEMENT]: > > put (x: ELEMENT; key: STRING) is > -- Insert x so that it will be retrievable through key. > require > count <=3D capacity > not key.empty > do > ... Some insertion algorithm ... > ensure > has (x) > item (key) =3D x count =3D old count + 1 > end The post-condition may fails, while the pre-condition was fulfilled = (unless class DICTIONARY is weird). At least, a good candidate for a = legitimate exception raise :p -- = =E2=80=9CSyntactic sugar causes cancer of the semi-colons.=E2=80=9D [Ep= igrams on = Programming =E2=80=94 Alan J. =E2=80=94 P. Yale University] =E2=80=9CStructured Programming supports the law of the excluded muddle.= =E2=80=9D [Idem]