comp.lang.ada
 help / color / mirror / Atom feed
From: mheaney@on2.com (Matthew Heaney)
Subject: Re: Elaboration of nested generic package.
Date: 8 Jul 2003 10:46:18 -0700
Date: 2003-07-08T17:46:19+00:00	[thread overview]
Message-ID: <1ec946d1.0307080946.7e61cda9@posting.google.com> (raw)
In-Reply-To: 5437fafb.0307071905.5d3bbc4e@posting.google.com

dlwester@hotmail.com (Don Westermeyer) wrote in message news:<5437fafb.0307071905.5d3bbc4e@posting.google.com>...
> christoph.grein@eurocopter.com wrote in message news:<mailman.0.1057119854.328.comp.lang.ada@ada.eu.org>...
> > 
> > There is no need to put pragma Elaborate_Body into the nested generic, because 
> > the body of Example also holds the body of Nested, and when the body of Example 
> > is elaborated, the body of Nested is inevitably elaborated as well.
> > 
> > What you cite in the style guide applies only to library generic units (or 
> > should that be generic library units :-):
> > http://www.adaic.org/docs/95style/html/sec_8/8-4-3.html

I don't think it matters much what the generic itself says.  Whenever
you instantiate a generic package, you should always Elaborate_All on
the with clause:

with GP;
pragma Elaborate_All (GP);  --you need this

package body Q is
   package P is new GP;
end Q;

See the CLA thread "AQ&S Guidance on pragma Elaborate_Body" which
occurred in 1997/04 -- particularly the responses from Bob Duff and
Robert Dewar.

I forget whether you need the pragma for root-level instantiations:

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

I don't think the pragma inside the generic declaration does very
much, except to indicate to the reader about whether the package uses
named access types, etc.  It's the Elaborate_All pragma that's
important for generics.

Perhaps Bob Duff can, er, elaborate.

-Matt



  reply	other threads:[~2003-07-08 17:46 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 [this message]
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
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