Re: unsigned type
- From: AdaMagica <christoph.grein@xxxxxxxxxxxxxx>
- Date: Sun, 12 Jul 2009 11:24:03 -0700 (PDT)
On 12 Jul., 19:57, Samuel Tardieu <s...@xxxxxxxxxxx> wrote:
"anon" == anon <a...@xxxxxxxx> 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 -- s...@xxxxxxxxxxx --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.
.
- References:
- Re: unsigned type
- From: Hibou57 (Yannick Duchêne)
- Re: unsigned type
- From: anon
- Re: unsigned type
- From: Samuel Tardieu
- Re: unsigned type
- Prev by Date: Re: getting back to null range
- Next by Date: Re: Dispatch on the result still does not work?
- Previous by thread: Re: unsigned type
- Next by thread: Re: unsigned type
- Index(es):
Relevant Pages
|