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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,3897c688f0b1f34c X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.224.10.6 with SMTP id n6mr26492584qan.4.1366979209430; Fri, 26 Apr 2013 05:26:49 -0700 (PDT) X-Received: by 10.49.27.233 with SMTP id w9mr3828504qeg.23.1366979209338; Fri, 26 Apr 2013 05:26:49 -0700 (PDT) Path: ef9ni16888qab.0!nntp.google.com!gp5no7166388qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 26 Apr 2013 05:26:49 -0700 (PDT) In-Reply-To: <09e7fbc6-ea75-4660-8ece-25c5b096afd5@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=129.59.203.209; posting-account=7Oy7OQoAAABhVYFOo553Cn1-AaU-bSfl NNTP-Posting-Host: 129.59.203.209 References: <09e7fbc6-ea75-4660-8ece-25c5b096afd5@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <3861a3cd-2513-4871-9062-2f2a53eb106b@googlegroups.com> Subject: Re: Ada202X : alternate syntax for ranged scalars From: Eryndlia Mavourneen Injection-Date: Fri, 26 Apr 2013 12:26:49 +0000 Content-Type: text/plain; charset=ISO-8859-1 Date: 2013-04-26T05:26:49-07:00 List-Id: On Friday, April 26, 2013 5:10:01 AM UTC-5, Martin wrote: > The default scalar declarations are 'closed ranges', i.e. include both upper and lower in the valid range. > > Sometimes we would like to specify a 'half open range', e.g. values of degree from 0.0 up to BUT NOT INCLUDING 360.0. > > I'm floating (pun intended) an alternative syntax for specify such ranges (or 'intervals')... > > type Degree is digits 15 range [0.0, 360.0); -- includes 0 but not 360 > > The current 'closed ranges' would be: > type Degree is digits 15 range [0.0, 360.0]; -- includes 0 and 360 > > Fully open range, i.e. not include 0.0 or 360.0: > > type Degree is digits 15 range (0.0, 360.0); -- includes neither 0 nor 360 > > A 'reverse' half open range, i.e. not include 0.0 but including 360.0: > > Usual rules would apply to the simple expression between the brackets. > > Any thoughts? > -- Martin I agree with Peter. A syntax more closely allied with current syntax might be: type Degree is digits 15 range 0.0 .. not 360.0; -- includes 0 but not 360 The current 'closed ranges' would be the same as now: type Degree is digits 15 range 0.0 .. 360.0; -- includes 0 and 360 Fully open range, i.e. not include 0.0 or 360.0: type Degree is digits 15 range not 0.0 .. not 360.0; -- includes neither 0 nor 360 That said, we must assume that floating point values get translated *exactly*; that is, 360.0 does not get translated to a machine type of 359.999999... or 360.0111111... -- Eryndlia F. Mavourneen