comp.lang.ada
 help / color / mirror / Atom feed
From: kanderso@etoile.ics.uci.edu (Ken Anderson)
Subject: Re: derived types in package specs
Date: 21 Apr 89 23:12:34 GMT	[thread overview]
Message-ID: <12448@paris.ics.uci.edu> (raw)

>  This disallows things like
>     type this is new integer;
>     type that is new this;

   The rationale behind this is due to the fact that a derived type receives
it's parents subprograms. I.E. ALRM 3.4(13):

   "The specification of a derived subprogram is obtained implicitly by 
    systematic replacement of the parent type by the derived type in the
    specification of the derivable subprogram..."

Thus because your context is in the package specification, before you can 
derive a new type from this (taken from the example above), all of the
subprograms (and subtypes, expressions, ...) that use type this, must be 
defined. The compiler will not know that all of these have been defined until
it has finished compiling the spec. This insures that everything that must
be derived for a new type is known.


package That is

   type this is new integer;

end That;


------ In some other unit,

with That;
procedure Who is

   type that is new That.this;

begin
   null;
end Who;




Ken Anderson
U.C. Irvine
Go Anteaters!

             reply	other threads:[~1989-04-21 23:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1989-04-21 23:12 Ken Anderson [this message]
  -- strict thread matches above, loose matches on Subject: below --
1989-04-20 17:34 derived types in package specs Alex Blakemore
1989-04-23  1:50 ` Orville Weyrich
1989-04-24 15:27 ` Robert Eachus
replies disabled

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