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,b78c363353551702 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.220.230 with SMTP id pz6mr22762113pbc.3.1340201616237; Wed, 20 Jun 2012 07:13:36 -0700 (PDT) Path: l9ni72599pbj.0!nntp.google.com!news2.google.com!news.glorb.com!feeder.erje.net!news2.arglkargh.de!news.mixmin.net!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: about the new Ada 2012 pre/post conditions Date: Wed, 20 Jun 2012 16:13:36 +0200 Organization: cbb software GmbH Message-ID: <1hgo6aks03zy.by4pq4xbjsgf$.dlg@40tude.net> References: Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2012-06-20T16:13:36+02:00 List-Id: On Wed, 20 Jun 2012 08:39:50 -0500, Nasser M. Abbasi wrote: [...] > But, and here is the problem, when I turn off assertions, I am > now left with the push() function with no check at all for > the case of the stack is full. > > So, what is one to do? use pre/post AND also add > an extra check for full stack in the code as before? > does not make sense. This is what constitutes the core inconsistency about dynamic pre-/post-conditions. If they #1 implement behavior (e.g the stack contract to raise something when full), then they cannot be suppressed and do not describe the contract. If they do describe the contract #2, they may not implement it and thus shall have no run-time effect. > They seem to definitely be something good to have. Not everything is what it seems... -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de