[net.lang.ada] static subtypes

greg@verdix.UUCP (11/05/83)

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