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.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no 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.15.105 with SMTP id w9mr3465471pbc.7.1322038252188; Wed, 23 Nov 2011 00:50:52 -0800 (PST) Path: lh20ni8412pbb.0!nntp.google.com!news1.google.com!goblin3!goblin.stu.neva.ru!news.tu-darmstadt.de!news.internetdienste.de!noris.net!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Wed, 23 Nov 2011 09:50:26 +0100 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Generic-Package Elaboration Question / Possible GNAT Bug. 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> In-Reply-To: Message-ID: <4eccb3d3$0$6627$9b4e6d93@newsspool2.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 23 Nov 2011 09:50:27 CET NNTP-Posting-Host: 1c2611db.newsspool2.arcor-online.net X-Trace: DXC=OA6?jTSE^9cg`45cDR8l?oA9EHlD;3Ycb4Fo<]lROoRa8kFejVh1:G4`DH3cXlMJli[cA9_0i X-Complaints-To: usenet-abuse@arcor.de Xref: news1.google.com comp.lang.ada:19065 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: 2011-11-23T09:50:27+01:00 List-Id: On 23.11.11 04:49, Yannick Duchêne (Hibou57) wrote: > Le Tue, 22 Nov 2011 16:02:06 +0100, Georg Bauhaus a écrit: >> [1] http://www.eiffel.com/developers/design_by_contract_in_detail.html > Oops, not good for its claims, an exemple DbC™ use case in this page is erroneous: Care to show where the error is? >> 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 <= capacity >> not key.empty >> do >> ... Some insertion algorithm ... >> ensure >> has (x) >> item (key) = x count = 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 `put`, in DbC, may fail when it tries to establish the state of variables so that the postcondition is true, for example, because of a hardware error. Can this be attributed to an incomplete precondition, though?