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,CP1252 X-Google-Thread: 103376,b1264e586250f470 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-07-10 08:39:49 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!arclight.uoregon.edu!wn13feed!wn12feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!rwcrnsc51.ops.asp.att.net.POSTED!not-for-mail Message-ID: <3F0D88A3.2040805@attbi.com> From: "Robert I. Eachus" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Elaboration of nested generic package. 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> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit NNTP-Posting-Host: 24.62.164.137 X-Complaints-To: abuse@comcast.net X-Trace: rwcrnsc51.ops.asp.att.net 1057851588 24.62.164.137 (Thu, 10 Jul 2003 15:39:48 GMT) NNTP-Posting-Date: Thu, 10 Jul 2003 15:39:48 GMT Organization: Comcast Online Date: Thu, 10 Jul 2003 15:39:48 GMT Xref: archiver1.google.com comp.lang.ada:40170 Date: 2003-07-10T15:39:48+00:00 List-Id: Matthew Heaney wrote: > I would still like a definitive answer, though. In order to make a > library-level package instantiation, do I need to use Elaborate_All on > the generic unit? (As in the example above.) Hmmm. A marginal case, but I would go ahead and do it. You are using the generic declaration before the main program starts, but may or may not need Elaborate_All instead of Elaborate. Use of Elaborate is deprecated. There are cases where Elaborate will work but Elaborate_All can't. However, it is unlikely that you will run into one. > Also: do the categorization pragmas in a generic unit make any > difference? In other words, you still need to say Elaborate_All, > irrespective of what the generic unit says about categorization -- > correct? Technically, the right answer is that you don't need Elaborate or Elaborate_All for packages without bodies. This is very different from what the categorization pragmas do. Most compilers today try to elaborate the body immediately after the package specification whenever possible. So all these discussions of pragma Elaborate_All really deal with the cases where that is not possible. Let me give an example: package Foo is...end Foo; with Foo; package Bar is...end Bar; with Bar; package body Foo is...end Foo; package body Bar is...end Bar; Once you have this sort of loop, elaboration can become an issue. In this case there is nothing in the language rules that determines whether the body of Foo will be elaborated before the body of Bar (or vice-versa) absent pragmas. Most of the time it won't matter. But if you know that elaboration of the body of Foo will call a subprogram in Bar, you should provide the pragma. Or elaboration of the body of Bar could call a subprogram in Foo. If both occur, or could occur, that is when you have elaboration problems. -- Robert I. Eachus �In an ally, considerations of house, clan, planet, race are insignificant beside two prime questions, which are: 1. Can he shoot? 2. Will he aim at your enemy?� -- from the Laiden novels by Sharon Lee and Steve Miller.