From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b1264e586250f470 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-07-08 10:46:19 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: mheaney@on2.com (Matthew Heaney) Newsgroups: comp.lang.ada Subject: Re: Elaboration of nested generic package. Date: 8 Jul 2003 10:46:18 -0700 Organization: http://groups.google.com/ Message-ID: <1ec946d1.0307080946.7e61cda9@posting.google.com> References: <5437fafb.0307071905.5d3bbc4e@posting.google.com> NNTP-Posting-Host: 66.162.65.162 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1057686379 13704 127.0.0.1 (8 Jul 2003 17:46:19 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 8 Jul 2003 17:46:19 GMT Xref: archiver1.google.com comp.lang.ada:40130 Date: 2003-07-08T17:46:19+00:00 List-Id: dlwester@hotmail.com (Don Westermeyer) wrote in message news:<5437fafb.0307071905.5d3bbc4e@posting.google.com>... > christoph.grein@eurocopter.com wrote in message news:... > > > > 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