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.228.227 with SMTP id sl3mr6887991pbc.5.1340449290478; Sat, 23 Jun 2012 04:01:30 -0700 (PDT) Path: l9ni10376pbj.0!nntp.google.com!news2.google.com!goblin2!goblin.stu.neva.ru!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: Sat, 23 Jun 2012 13:01:17 +0200 Organization: cbb software GmbH Message-ID: <1mkp7fzlk1b0y.1ueinfjn48fcy$.dlg@40tude.net> References: <1hgo6aks03zy.by4pq4xbjsgf$.dlg@40tude.net> <1jvy3elqtnd1j.1sjbk32evhp1f$.dlg@40tude.net> <1oih2rok18dmt.avbwrres5k12.dlg@40tude.net> <4fe59ea0$0$9502$9b4e6d93@newsspool1.arcor-online.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: q1gJPV1SC/KP9ydRbYoWiw.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-23T13:01:17+02:00 List-Id: On Sat, 23 Jun 2012 12:46:56 +0200, Georg Bauhaus wrote: > On 23.06.12 01:08, Dmitry A. Kazakov wrote: >>> And Ada*always* has had dynamic preconditions: >>> > >>> > procedure New_Line (Spacing : in Positive_Count := 1); >> The precondition here is Spacing in Positive_Count'Base because the >> behavior of New_Line is*defined* when Spacing is not in >> Positive_Count'Range. >> >> New_Line(0) >> >> is a*legal* Ada program. > > The behavior of New_Line is not relevant, It is OK if New_Line(0) would reboot the computer? New_Line(0) is not straight legal, it not an error in the classification of errors (RM 1.1.5). Compare: a contract violation is an *unbounded ERROR*. Aside. If you could estimate the effect of a contract violation, in order to make the case for a bounded error, that would not save the idea of checking either. Because, of course, in that case you also could detect the violation itself, which is a much simpler task than tracking all possible consequences down. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de