Null discrete range as an array aggregate choice AI-00414/04 1 88-06-17 BI WA | !standard 04.03.02 (03) 88-06-17 AI-00414/04 !class binding interpretation 86-03-25 | !status approved by WG9 87-12-07 | !status panel/committee-approved 87-08-31 (reviewed) !status panel-approved (10-0-3) 87-06-30 (by mail; pending editorial review) !status committee-approved (9-0-0) 87-05-26 (pending editorial review) !status work-item 87-04-17 !status received 86-03-25 !references 83-00720 !topic Null discrete range as an array aggregate choice | !summary 88-06-15 A named association of an array aggregate is only allowed to have a choice | that is a null discrete range if the aggregate includes a single component association and this component association has a single choice. !question 87-08-31 4.3.2(3) says: A named association of an array aggregate is only allowed to have a choice that is not static, or likewise a choice that is a null range, if the aggregate includes a single component association and this component association has a single choice. The wording "null range" refers only to choices that syntactically have the form L..R or ARR'RANGE (since "range" is a syntactic term [1.5(6)]). In particular, the restriction in 4.3.2(3) does not exclude an empty others choice or a subtype indication that has a null range. Was the intent to disallow an empty others choice or a choice that is a null discrete range? | !recommendation 88-06-15 A named association of an array aggregate is only allowed to have a choice | that is a null discrete range if the aggregate includes a single component association and this component association has a single choice. | !discussion 88-06-15 Consider the following examples: type ARR is (1 .. 3) of INTEGER; subtype NR is INTEGER range 2 .. 1; X : ARR := (1, 2, 3, others => 4); -- 1 | Y : ARR := (1, 2, 3, 2 .. 1 => 4); -- 2 illegal | Z : ARR := (1, 2, 3, NR => 4); -- 3 illegal | Z1 : ARR := (1, 2, 3, NR => 4, NR => 5); -- 4 illegal Example 1 is legal because 4.3(5) allows an others choice that specifies all remaining components, "if any." Null discrete range as an array aggregate choice AI-00414/04 2 88-06-17 BI WA Example 2 is clearly illegal since 2..1 is a null range. Example 3 is intended to be illegal, but is not ruled out by the current wording, since NR is not a range, but is a discrete_range (see 3.6(2)). Example 4 is intended to be illegal, but is also not ruled out by the current wording. To satisfy the intent of making examples 3 and 4 illegal, 4.3.2(3) should be understood to prohibit null discrete ranges when there is more than one component association or more than one choice in a component association. Prohibiting null discrete ranges does not affect the legality of example 1 since an others choice is not, syntactically, a discrete range.