comp.lang.ada
 help / color / mirror / Atom feed
From: markb@sdcrdcf.UUCP (Mark Biggar)
Subject: Re: Another question about types and subypes
Date: Thu, 14-Aug-86 18:23:09 EDT	[thread overview]
Date: Thu Aug 14 18:23:09 1986
Message-ID: <2957@sdcrdcf.UUCP> (raw)
In-Reply-To: 2956@sdcrdcf.UUCP

In article <2956@sdcrdcf.UUCP> steve@sdcrdcf.UUCP (Steven Holtsberg) writes:
>
>On page 3-15, section 3.5.4, the ARM says:
>
>A type declaration of the form:
>
>    type T is range L .. R;
>
>is, by definition equivalent to the following declarations:
>
>    type <integer_type> is new predefined_integer_type;
>    subtype T is <integer_type> range <integer_type>(L) .. <integer_type>(R);
>
>It then goes on to refer to T as a _type_ :
>"The elaboration of the declaration of an integer _type_ ...".
>However, the "equivalent" pair of declarations given does
>_not_ declare a new type named T, is declares an anonymous
>type (integer_type) and a _subtype_ T.
>
>Are they lying, or are they just careless?

No just pragmatic, They use T as the name of the type, even though it's
really only a subtype, because there is no other name they can use.

The LRM explisitly outlaws using T'BASE as the name of the type.

Note also that subtypes are used to rename types as in:

subtype FOO is BAR;

After this there is no difference between FOO and BAR to the compiler.

Mark Biggar
{allegra,burdvax,cbosgd,hplabs,ihnp4,akgua,sdcsvax}!sdcrdcf!markb

      reply	other threads:[~1986-08-14 22:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1986-08-14 22:12 Another question about types and subypes Steven Holtsberg
1986-08-14 22:23 ` Mark Biggar [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