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-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!j19g2000vbp.googlegroups.com!not-for-mail From: AdaMagica Newsgroups: comp.lang.ada Subject: Re: unsigned type Date: Sun, 12 Jul 2009 11:24:03 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <878witokbn.fsf@willow.rfc1149.net> NNTP-Posting-Host: 91.13.241.46 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1247423043 27745 127.0.0.1 (12 Jul 2009 18:24:03 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 12 Jul 2009 18:24:03 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: j19g2000vbp.googlegroups.com; posting-host=91.13.241.46; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:7020 Date: 2009-07-12T11:24:03-07:00 List-Id: On 12 Jul., 19:57, Samuel Tardieu wrote: > >>>>> "anon" =3D=3D anon =A0 writes: > > anon> But some here and the GNAT compiler says the ( 1 .. 0 ) and ( -5 > anon> .. -7 ) are both valid in the source code. =A0A string with the > anon> range of ( -5 .. -7 ) looks like bad C coding anfd that's not Ada. > > The RM says that explicitely: > > RM 3.5 (4): "A range has a lower bound and an upper bound and specifies > a subset of the values of some scalar type (the type of the range). A > range with lower bound L and upper bound R is described by ``L > .. R''. If R is less than L, then the range is a null range, and > specifies an empty set of values. Otherwise, the range specifies the > values of the type from the lower bound to the upper bound, inclusive." > > RM 3.5 (8): "A range is compatible with a scalar subtype if and only if > it is either a null range or each bound of the range belongs to the > range of the subtype. A range_constraint is compatible with a scalar > subtype if and only if its range is compatible with the subtype." > > So 1 .. 0 or -5 .. -7 are null ranges, thus compatible with a Positive > range. > > =A0 Sam > -- > Samuel Tardieu -- s...@rfc1149.net --http://www.rfc1149.net/ My dear Sam, this is Love's Labour's Lost because this has been pointed out to anon several times in this discussion - he just won't listen.