comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <spam.jrcarter.not@spam.acm.org>
Subject: Re: Subtypes boundaries
Date: Mon, 14 Jun 2010 13:36:13 -0700
Date: 2010-06-14T13:36:13-07:00	[thread overview]
Message-ID: <hv640h$th1$1@tornado.tornevall.net> (raw)
In-Reply-To: <87nhicFa1kU1@mid.individual.net>

Nobody wrote:
> 
> I am new to Ada and found the following declaration in my text book:
> 
> type ASTERIX is range -5_000..+10_000;
> subtype IDEFIX is range 1..20_000;

Which text book are you using? All caps for identifiers has not been commonly 
used for 15 years or more.

If you really found that in your text, you should get another text. The 
declaration of Idefix is invalid, as it does not give the parent subtype. A 
valid subtype declaration is

subtype Positive is Integer range 1 .. Integer'Last;

You are correct that the range of a subtype cannot exceed that of its parent.

-- 
Jeff Carter
"Apart from the sanitation, the medicine, education, wine,
public order, irrigation, roads, the fresh water system,
and public health, what have the Romans ever done for us?"
Monty Python's Life of Brian
80



  reply	other threads:[~2010-06-14 20:36 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 [this message]
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
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