comp.lang.ada
 help / color / mirror / Atom feed
From: Nobody <nobody@nowhere.org>
Subject: Re: Subtypes boundaries
Date: 15 Jun 2010 01:05:45 GMT
Date: 2010-06-15T01:05:45+00:00	[thread overview]
Message-ID: <87o1v9FvpjU1@mid.individual.net> (raw)
In-Reply-To: op.vebcy90dxmjfy8@garhos

On Tue, 15 Jun 2010 01:31:47 +0200 Yannick Duchêne (Hibou57) wrote:

> [ARM 2005 3.5(5)] just says:
>> For a subtype_indication containing a range_constraint, either directly
>> or as part of some other scalar_constraint, the type of the range shall
>> resolve to that of the type determined by the subtype_mark of the
>> subtype_indication.
> 
The annotated ARM says:

3.5 Scalar Types, 8.a
Ramification: Only range_constraints (explicit or implicit) impose 
conditions on the values of a scalar subtype. The other 
scalar_constraints, digit_constraints and delta_constraints impose 
conditions on the subtype denoted by the subtype_mark in a 
subtype_indication, but don't impose a condition on the values of the 
subtype being defined. Therefore, a scalar subtype is not called 
constrained if all that applies to it is a digits_constraint. Decimal 
subtypes are subtle, because a digits_constraint without a 
range_constraint nevertheless includes an implicit range_constraint. 

What I understand is that a subtype shall in maximum contain all values 
of the subtype indicator, i.e. the superordinated type. Therefore the 
definition

type ASTERIX range +5_000..10_000;
subtype IDEFIX is ASTERIX range 1..20_000;

should in ANY case cause a compile time error!!!

At least I would expect this behaviour.

Regards

Nobody





  parent reply	other threads:[~2010-06-15  1:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-14 20:25 Subtypes boundaries Nobody
2010-06-14 20:36 ` Jeffrey R. Carter
2010-06-17 18:54   ` Nobody
2010-06-17 18:58     ` Nasser M. Abbasi
2010-06-17 19:17     ` Jeffrey R. Carter
2010-06-17 19:53     ` Ludovic Brenta
2010-06-14 20:43 ` Nobody
2010-06-14 21:01   ` Gautier write-only
2010-06-14 23:31     ` Yannick Duchêne (Hibou57)
2010-06-15  0:01       ` Peter C. Chapin
2010-06-15  0:58         ` Adam Beneschan
2010-06-15  1:05       ` Nobody [this message]
2010-06-15  1:20         ` Adam Beneschan
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox