Ancestor library unit for secondary units and subunits AI-00482/04 1 88-11-04 BI WA | !standard 10.02 (05) 88-11-04 AI-00482/04 !class binding interpretation 86-10-13 | !status approved by WG9 88-10-28 !status ARG-approved 88-05-10 (reviewed) !status ARG-approved (16-0-0) 87-09-15 (pending editorial review) !status panel-approved (6-0-0) 87-09-15 !status work-item 87-03-23 !status received 86-10-13 !references 83-00827 !topic Ancestor library unit for secondary units and subunits !summary 88-04-13 The ancestor library unit of a subunit is the parent unit if the parent is a library unit; it is the corresponding library unit if the parent is a library unit body; and otherwise it is the ancestor library unit of the parent. !question 87-04-19 10.2(2) gives the syntax for a subunit as: subunit ::= separate (PARENT_UNIT_name) proper_body 10.2(5) says: Each subunit mentions the name of its parent unit, that is, the compilation unit where the corresponding body stub is given. If the parent unit is a library unit, it is called the ancestor library unit. If the parent unit is itself a subunit, the parent unit name must be given in full as an expanded name, starting with the simple name of the ancestor library unit. The simple names of all subunits that have the same ancestor library unit must be distinct identifiers. 10.2(5) defines the ancestor library unit of a subunit whose parent unit is a library unit, but it does not define the ancestor library unit of a subunit whose parent unit is either a secondary unit or a subunit. What is the definition in these cases? For example: procedure L; -- library unit procedure L is -- secondary unit procedure S1 is separate; begin ... end L; Ancestor library unit for secondary units and subunits AI-00482/04 2 88-11-04 BI WA separate (L) -- parent unit is secondary unit L procedure S1 is procedure S2 is separate; begin ... end S1; separate (L.S1) -- ancestor unit is L? (yes) procedure S2 is begin ... end S2; Strictly speaking, no ancestor library unit is defined for S1 or S2, since the parent units in each case are not library units. !recommendation 88-04-13 The ancestor library unit of a subunit is the parent unit if the parent is a library unit; it is the corresponding library unit if the parent is a library unit body; and otherwise it is the ancestor library unit of the parent. !discussion 87-04-19 The third sentence of 10.2(5) clearly shows the intended definition of ancestor library unit.