On the elaboration of library units 86-12-01 AI-00354/03 1 | !standard 10.05 (02) 86-12-01 AI-00354/03 | !class ramification 85-06-18 | !status approved by WG9/AJPO 86-11-26 | !status approved by Director, AJPO 86-11-26 | !status approved by WG9/Ada Board 86-11-18 !status panel/committee-approved 86-08-07 (reviewed) !status committee-approved (8-0-1) 86-05-12 (pending editorial review) !status work-item 86-04-08 !status received 85-06-18 !references 83-00562, 83-00568 !topic On the elaboration of library units !summary 86-07-07 There is no requirement that the body of a library unit be elaborated as soon as possible after the library unit is elaborated. In particular, the pragma ELABORATE should be used if it is important that a library package's body be elaborated before another package is elaborated. !question 86-04-15 10.5(2) says: The elaboration of these library units and of the corresponding library unit bodies is performed in an order consistent with the partial ordering defined by the with clauses ... Does this wording define the order of library unit bodies in the elaboration? Consider the following example: -- unit 1 package P is A : INTEGER := 5; end; -- unit 2 package body P is begin A := 10; end; -- unit 3 with P; use P; package Q is B : INTEGER := A; end; with Q; use Q; procedure R is begin PUT(B); -- the result of this B end; On the elaboration of library units 86-12-01 AI-00354/03 2 Are the following interpretations correct? a. When the order of elaboration is 1-2-3, the value of the variable B is 10. b. When the order of elaboration is 1-3-2, the value of the variable B is 5. !response 86-07-07 There is no requirement that a library unit body be elaborated as soon as possible. In particular P's package body need not be elaborated as soon as possible after P's specification is elaborated, so the orders 1-2-3 and 1-3-2 are both permitted before executing main program R. The pragma ELABORATE should be used if it is important that P's body be elaborated before package Q is elaborated.