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=2.2 required=5.0 tests=BAYES_00,HK_RANDOM_FROM, HK_RANDOM_REPLYTO,INVALID_MSGID,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,16e3a8dd4f3ab3f3 X-Google-Attributes: gid103376,public From: cmcknigh@hercii.lasc.lockheed.com (Chris McKnight) Subject: Re: Elaboration order Date: 1996/03/19 Message-ID: <1996Mar19.023129.27619@enterprise.rdd.lmsc.lockheed.com>#1/1 X-Deja-AN: 143625546 sender: news@enterprise.rdd.lmsc.lockheed.com (News Administrator) references: <314D2E1C.5C72@lfwc.lockheed.com> organization: Lockheed Martin Aeronautical Systems reply-to: cmcknigh@hercii.lasc.lockheed.com newsgroups: comp.lang.ada Date: 1996-03-19T00:00:00+00:00 List-Id: In article 5C72@lfwc.lockheed.com, Ken Garlington () writes: >Mark A Biggar wrote: >> >> In article <31494143.3825@lfwc.lockheed.com> Ken Garlington writes: >> >Robert A Duff wrote: >> >[the standard answer, except it didn't explain...] >> >Why doesn't the subprogram body have to be elaborated before the call? >> >> It does. > >Please cite the Ada 83 reference for this. I can't find it. > Guess you didn't read my response. The reference Ada 83 LRM reference is 7.3 paragraph 4, the key line being: " ...a call of such a subprogram by an outside program unit raise the exception PROGRAM_ERROR if the call takes place before the elaboration of the package body" >In fact, in general, for all respondents to this question, if you >say that pragma Elaborate is _not_ needed in a particular context, >please cite an 83 reference. A reference to when something is NOT needed? Would you expect such a thing? Think about it; do you really expect a specific reference to when.. say NUMERIC_ERROR is NOT raised? Look at it this way, since all discussion in the LRM for pragma Elaborate lists the kind of cases you may need it for, the easiest way to determine that it is not needed is to determine that your code can not fall into one of these cases. And since all of these cases involve actions which occur during elaboration, the easiest way to avoid it is not to make these type of assignments during elaboration. This is especially true if you are directing others. It's far easier to say "No assignments of this type during elaboration" than to list when one may or may not need to use pragma Elaborate. > I can't even find a reference that >says the body can be assured of the elaboration of its own spec! The requirement for a spec to be elaborated before the body is in 3.9 Declarative Parts. Paragraph 3 states that the elaboration of a declarative part consists of the elaboration of the declarative items "in the order in which they are given in the declarative part". And I think it's clear that the order given in the declarative part is required to be spec before body. See 3.9 paragraph 9 for that specific requirement for your example. But again, I ask, "Why worry about elaboration order problems when they are easily avoided?" Cheers, Chris