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: a07f3367d7,6327f05d4989a68d X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.180.19.194 with SMTP id h2mr4973169wie.0.1356185846887; Sat, 22 Dec 2012 06:17:26 -0800 (PST) Path: i11ni256278wiw.0!nntp.google.com!feeder3.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.83.MISMATCH!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!feeder.erje.net!us.feeder.erje.net!gandalf.srv.welterde.de!news.jacob-sparre.dk!munin.jacob-sparre.dk!nuzba.szn.dk!pnx.dk!news.stack.nl!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Press Release - Ada 2012 Language Standard Approved by ISO Date: Wed, 19 Dec 2012 10:19:03 +0100 Organization: cbb software GmbH Message-ID: References: <7wrdmbre6jw9.qww9l0uzj6mg.dlg@40tude.net> <50d18248$0$6571$9b4e6d93@newsspool3.arcor-online.net> 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-12-19T10:19:03+01:00 List-Id: On Wed, 19 Dec 2012 10:00:57 +0100, Georg Bauhaus wrote: > On 19.12.12 09:33, Dmitry A. Kazakov wrote: > >> Take an instance of Ada.Numerics.Discrete_Random and do: >> >> subtype More_Fun_Number is Integer with >> Dynamic_Predicate => Random = More_Fun_Number; > > You could use > > subtype More_Fun_Number is Integer with > Dynamic_Predicate => At_Least_A_Thousand > (Random (G), More_Fun_Number); > > to test whether or not your random number generator is, say, > dodging at least 1_000 numbers that your algorithm happens > to produce, and assign, in a predictable way. > > This approach doesn't seem so wrong in case one cannot know > the result in advance, but operation of the program critically > depends on certain properties of those unknown parts. It is deeply wrong. A [sub]type should describe some class of entities sharing common properties and behavior. P.S. It is frequently said that Ada cannot not prevent you from shooting yourself in the foot. But not with a bazooka... -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de