comp.lang.ada
 help / color / mirror / Atom feed
From: bobduff@world.std.com (Robert A Duff)
Subject: Re: QUIZ: To be or not to be (able to post)
Date: 1997/10/03
Date: 1997-10-03T00:00:00+00:00	[thread overview]
Message-ID: <EHHp4E.AC4@world.std.com> (raw)
In-Reply-To: 6114h5$pmk@news3.his.com


In article <6114h5$pmk@news3.his.com>,
Joel VanLaven  <jvl@ocsystems.com> wrote:
>...  I am just a little
>surprised that the "obvious" big difference (between float and float'base) 
>wasn't really a difference at all.

If you say:

    type T1 is range -10..10;
    type T2 is digits 5 range -10.0..10.0;

then T1 and T2 are constrained.  On the other hand, if you say:

    type T3 is digits 5; -- no range given here

then T3 is unconstrained.  So T3 is the same thing as T3'Base (both are
unconstrained).  But T1 and T1'Base are different, and T2 and T2'Base
are different (T1 and T2 are constrained; T1'Base and T2'Base are
unconstrained).

The predefined floating point types, such as Float, are like T3 in this
regard.  That is, Float is unconstrained, so Float is the same thing as
Float'Base.  This is because the declaration of Float has no "something
.. something else".  See A.1(20).

The predefined integer types, such as Integer, are constrained.

This all makes sense to me.  The "surprise" probably comes from the fact
that this is different from Ada 83, where the first subtype was always
constrained in the floating-point case.

- Bob




      reply	other threads:[~1997-10-03  0:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-09-29  0:00 QUIZ: To be or not to be (able to post) Geert Bosch
1997-09-30  0:00 ` Tucker Taft
1997-09-30  0:00 ` Matthew Heaney
1997-10-02  0:00 ` Joel VanLaven
1997-10-02  0:00   ` Tucker Taft
1997-10-02  0:00     ` Joel VanLaven
1997-10-03  0:00       ` Robert A Duff [this message]
replies disabled

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