From: greg@verdix.UUCP
Subject: static subtypes
Date: Fri, 4-Nov-83 18:52:28 EST [thread overview]
Date: Fri Nov 4 18:52:28 1983
Message-ID: <159@verdix.UUCP> (raw)
It has been noted, and raised as an issue in this news group that an
in integer type declaration:
type T is range L..R; -- where L and R must be static
The type T is *not* a static range.
This comes about because in LRM 3.5.4 an integer type declaration is
defined as being equivalent to the following pair of declarations:
type integer_type is new predefined_integer_type;
subtype T is integer_type range integer_type(L)..integer_type(R);
Explicit type conversions are not static, thus the subtype T above is
not a static subtype.
Compare this with the derived type declaration:
type T is new INTEGER range L..R; -- where L and R are static.
Here, the derived subtype T is a static subtype because from LRM 3.4(3):
"If a constraint exists for the parent subtype, a similar constraint
exists for the derived subtype; the only difference is that for a
range constraint, and likewise for a floating or fixed point
constraint that includes a range constraint, the value of each
bound is replaced by the corresponding value of the derived type"
-----------------------------------
Thus, no conversions are required or implied.
Is this difference between integer type definitions and derived type
definitions intended?
Greg Burns, Verdix Corporation
gburns.oregon-grad@csnet-relay
{tektronix!ogcvax allegra!ogcvax inteloa decwrl!sequent}!verdix!greg
reply other threads:[~1983-11-04 23:52 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox