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: a07f3367d7,caabf5265fad78e5 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!news.glorb.com!de-l.enfer-du-nord.net!feeder.news-service.com!feeder.news-service.com!proxad.net!feeder2-2.proxad.net!cleanfeed2-b.proxad.net!nnrp20-2.free.fr!not-for-mail From: Samuel Tardieu Newsgroups: comp.lang.ada Subject: Re: unsigned type References: Date: Sun, 12 Jul 2009 19:57:48 +0200 Message-ID: <878witokbn.fsf@willow.rfc1149.net> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux) Cancel-Lock: sha1:f8NILVpSskIAimBL46cj7HSGtq8= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Leafnode-NNTP-Posting-Host: 2001:6f8:37a:2::2 Organization: Guest of ProXad - France NNTP-Posting-Date: 12 Jul 2009 20:00:01 MEST NNTP-Posting-Host: 91.121.19.179 X-Trace: 1247421601 news-4.free.fr 4052 91.121.19.179:53481 X-Complaints-To: abuse@proxad.net Xref: g2news2.google.com comp.lang.ada:7018 Date: 2009-07-12T20:00:01+02:00 List-Id: >>>>> "anon" == anon writes: anon> But some here and the GNAT compiler says the ( 1 .. 0 ) and ( -5 anon> .. -7 ) are both valid in the source code. A 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. Sam -- Samuel Tardieu -- sam@rfc1149.net -- http://www.rfc1149.net/