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,1552407353207252 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!in.100proofnews.com!in.100proofnews.com!newsfeed.cs.utexas.edu!geraldo.cc.utexas.edu!not-for-mail From: bdbryant@mail.utexas.edu (Bobby D. Bryant) Newsgroups: comp.lang.ada Subject: Re: Range constraints on subprogram parameters? Date: Fri, 30 Sep 2005 02:23:23 +0000 (UTC) Organization: dis- Message-ID: References: Reply-To: bdbryant@mail.utexas.edu NNTP-Posting-Host: dial-b-128-83-254-32.telesys.its.utexas.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: geraldo.cc.utexas.edu 1128047003 10852 128.83.254.32 (30 Sep 2005 02:23:23 GMT) X-Complaints-To: abuse@utexas.edu NNTP-Posting-Date: Fri, 30 Sep 2005 02:23:23 +0000 (UTC) X-Newsreader: knews 1.0b.1 Xref: g2news1.google.com comp.lang.ada:5293 Date: 2005-09-30T02:23:23+00:00 List-Id: On Thu, 29 Sep 2005, Peter Hermann wrote: > Jeffrey R. Carter wrote: >> Bobby D. Bryant wrote: >> > Is it possible to specify range constraints for subprogram parameters? >> > >> > E.g., if you want to require a floating point value in the range [0,1]. >> >> Of course: >> >> type Zip_2_1 is digits 6 range 0.0 .. 1.0; >> >> procedure Op (Number : in Zip_2_1); > > procedure Op (Number : in Zip_2_1 range 0.3 .. 0.7); > > may have been the original question? Yes, that's what I was wanting. It occurs to me in retrospect that it would be problematic from a language design perspective, since it would be impossible to enforce at compile time. Thanks to everyone who replied. -- Bobby Bryant Austin, Texas