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-16 08:24:15 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: 16 Jul 2003 08:24:14 -0700 Organization: http://groups.google.com/ Message-ID: <1ec946d1.0307160724.1ff7c5b5@posting.google.com> References: <5437fafb.0307071905.5d3bbc4e@posting.google.com> <1ec946d1.0307080946.7e61cda9@posting.google.com> <5437fafb.0307091710.5cb4b0eb@posting.google.com> <3F0CC2D1.10904@attbi.com> <1ec946d1.0307100612.20a3d000@posting.google.com> <1ec946d1.0307141035.3f1e4b80@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 1058369054 29583 127.0.0.1 (16 Jul 2003 15:24:14 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 16 Jul 2003 15:24:14 GMT Xref: archiver1.google.com comp.lang.ada:40340 Date: 2003-07-16T15:24:14+00:00 List-Id: "Randy Brukardt" wrote in message news:... > > 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?