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,6327f05d4989a68d X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.66.84.161 with SMTP id a1mr1369343paz.47.1355968357727; Wed, 19 Dec 2012 17:52:37 -0800 (PST) MIME-Version: 1.0 Path: 6ni54080pbd.1!nntp.google.com!news.glorb.com!feeder.erje.net!eu.feeder.erje.net!nuzba.szn.dk!news.jacob-sparre.dk!munin.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Press Release - Ada 2012 Language Standard Approved by ISO Date: Wed, 19 Dec 2012 19:52:33 -0600 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <7wrdmbre6jw9.qww9l0uzj6mg.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1355968356 29135 69.95.181.76 (20 Dec 2012 01:52:36 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Thu, 20 Dec 2012 01:52:36 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Date: 2012-12-19T19:52:33-06:00 List-Id: "Dmitry A. Kazakov" wrote in message news:7wrdmbre6jw9.qww9l0uzj6mg.dlg@40tude.net... ... > Take an instance of Ada.Numerics.Discrete_Random and do: > > subtype More_Fun_Number is Integer with > Dynamic_Predicate => Random = More_Fun_Number; A predicate (or any contract) that can get different answers on successive calls is *wrong*. Ada 2012 has a permission (11.4.2(27/3)) for implementations to reject such expressions if they can detect it. (This isn't required simply because we don't know of any way to characterize what should not be allowed -- that's a work item for future versions of Ada.) One would hope that obvious cases like this take advantage of the permission and are rejected outright. Functions in dynamic predicates (and all of the other contract aspects, as well) ought to be logically pure, returning the same result for the same parameter values. Randy.