comp.lang.ada
 help / color / mirror / Atom feed
From: mheaney@on2.com (Matthew Heaney)
Subject: Re: Elaboration of nested generic package.
Date: 16 Jul 2003 08:24:14 -0700
Date: 2003-07-16T15:24:14+00:00	[thread overview]
Message-ID: <1ec946d1.0307160724.1ff7c5b5@posting.google.com> (raw)
In-Reply-To: vh8dpifpmicl78@corp.supernews.com

"Randy Brukardt" <randy@rrsoftware.com> wrote in message news:<vh8dpifpmicl78@corp.supernews.com>...
> 
> A library unit pragma that applies to a generic unit does not apply to its
> instances, unless a specific rule for the pragma specifies the contrary.
> 
> That means that a categorization pragma does not apply to instances of the
> generic, only to the generic itself. (You need to be able to say that a
> generic is Pure so it can be withed and instantiated in a Pure package; but
> that doesn't necessaryly make it Pure - that depends on the formals).
> 
> The pragma on the instance is not "confirming"; it gives the categorization.
> 
> See AI-00041 for a full discussion.

OK, that clears things up a bit.  But I'm still confused about what
pragma should be used on the instantiation.

For example, in the AI, there's this example:

with Op;

generic 
package GP is
   pragma Preelaborate;
   I : Integer := Op;
   ...
end GP;

The pragma states that the body of GP should be elaborated prior to
the elaboration of any non-preelaborated library units, which means
you can omit elaboration checks during instantiations of GP.

Fine, but then what categorization pragma should one use on the
instantiation of GP:

with GP;
pragma Elaborate_All (GP);
package P is new GP;
pragma What_Goes_Here(P); --???

We can't use Preelaborate on P, because it isn't preelaborateable
(even though GP is).  What would be the difference between using
Elaborate_Body and Elaborate_All on P?



  reply	other threads:[~2003-07-16 15:24 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-02  4:13 Elaboration of nested generic package christoph.grein
2003-07-08  3:05 ` Don Westermeyer
2003-07-08 17:46   ` Matthew Heaney
2003-07-10  1:10     ` Don Westermeyer
2003-07-10  1:35       ` Robert I. Eachus
2003-07-10  4:51         ` Robert I. Eachus
2003-07-10  6:58           ` Jean-Pierre Rosen
2003-07-10 15:08             ` Robert I. Eachus
2003-07-11 21:26             ` Robert A Duff
2003-07-10 14:12         ` Matthew Heaney
2003-07-10 15:39           ` Robert I. Eachus
2003-07-11 21:41           ` Robert A Duff
2003-07-14 18:35             ` Matthew Heaney
2003-07-15 17:19               ` Randy Brukardt
2003-07-16 15:24                 ` Matthew Heaney [this message]
2003-07-17  2:08                   ` Randy Brukardt
2003-07-17 15:54                     ` Richard Riehle
2003-07-10 15:03         ` Don Westermeyer
2003-07-10 15:45       ` Matthew Heaney
  -- strict thread matches above, loose matches on Subject: below --
2003-07-09  5:21 christoph.grein
2003-07-01 20:14 Don Westermeyer
replies disabled

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