CVS difference for ai12s/ai12-0418-1.txt

Differences between 1.2 and version 1.3
Log of other versions for file ai12s/ai12-0418-1.txt

--- ai12s/ai12-0418-1.txt	2021/01/09 08:01:46	1.2
+++ ai12s/ai12-0418-1.txt	2021/01/13 06:30:51	1.3
@@ -1,4 +1,11 @@
-!standard 9.7.4(14/4)                                   21-01-08  AI12-0418-1/02
+!standard 4.3.1(17.2/5)                             21-01-12  AI12-0418-1/03
+!standard 4.3.3(10)
+!standard 4.3.5(76/5)
+!standard 4.5.2(3.1/4)
+!standard 5.5.2(10.2/5)
+!standard 9.7.4(14/4)                                 
+!standard 12.3(11)
+!standard 12.7(4.5/3)
 !class binding interpretation 20-12-14
 !status Amendment 1-2012 20-12-14
 !status work item 20-12-14
@@ -24,6 +31,25 @@
 (3) 5.5.2(10.2/5) uses commas oddly, and is hard to read because of its
 size. Should the comma use be improved, and the paragraph split? (Yes.)
 
+(4) In 4.3.1(17.2/5), the parenthesized (box) is weird. Other similar rules
+either do not include box at all (4.3.5(26/5), 12.7(4.5/3)) or include box 
+in the narrative text (4.3.4(11/5)), or even only use "box" but not <> 
+(12.6(10)). Should this be reworded? (Yes.)
+
+(5) 12.7(4.5/3) ends with "must be given by <> as well". ISO does not allow
+the use of the word "must" in normative text, and "as well" seems informal.
+Should this be reworded? (Yes.)
+
+(6) In 4.3.3(10), the wording of the "redundant" sentence is extremely
+pedantic and hard to follow. Should this be reworded? (Yes.)
+
+(7) The example 4.3.5(76/5) is pretty suboptimal as the conditional inside the 
+loop is not necessary. Should a simpler form be used? (Yes.)
+
+(8) In 4.5.2(3.1/4), "for" should be "of" for consistency, since the following 
+sentence uses "of" instead of "for". Change this? (Yes.)
+
+
 !recommendation
 
 (1) Add (see 9.8) after "abort completion points".
@@ -33,12 +59,74 @@
 (3) Add one comma, remove two others, replace "having" with "that has" (2
 places), and split into three parts.
 
+(4) Move box in front of "compound delimiter".
+
+[=== Editor's question: Argubly, 4.3.5(26/5) should be reworded to 
+include "box" somewhere, so that at least all of the rules in the 
+aggregate clauses are consistent. Or possibly make all three of 
+4.3.1(17.2/5), 4.3.4(11/5), and 4.3.5(26/5) use consistent wording
+-- these are all new Ada 202x rules. As that seemed to be a lot of churn,
+and the wording to chose is not obvious, I've left that decision open.===]
+
+(5) Replace "must" with "shall also", and delete "as well".
+
+(6) Remove the phrase "where an array_aggregate is permitted" and replace
+"the aggregate" with "an array_aggregate".
+
+(7) Replace the single loop with two loops, which is closer to the actual
+expansion.
+
+(8) Replace "for" with "of".
+
 !wording
 
 [Editor's note: These changes were applied to Draft 28 of the Ada 202x RM, 
 even though they have not yet been approved, in order that that draft be as
 accurate as possible.]
 
+Modify 4.3.1(17.2/5):
+
+ * use the {box} compound delimiter <> rather than an expression;
+
+Modify 4.3.3(10):
+
+An others choice is allowed for an array_aggregate only if an applicable index 
+constraint applies to the array_aggregate. An applicable index constraint is a
+constraint provided by certain contexts[ where an array_aggregate is permitted]
+that can be used to determine the bounds of the array value specified by [the 
+aggregate]{an array_aggregate}. Each of the following contexts (and none 
+other) defines an applicable index constraint: 
+
+Replace 4.3.5(76/5):
+
+   --  Is equivalent (assuming set semantics) to:
+   S := Empty_Set;
+   for Item in -5 .. 5 loop
+      if Item /= 0 then
+         Include (S, Item);
+      end if;
+   end loop;
+
+with:
+
+   --  Is equivalent (assuming set semantics) to:
+   S := Empty_Set;
+   for Item in 1 .. 5 loop
+      Include (S, Item)
+   end loop;
+   for Item in -5 .. -1 loop
+      Include (S, Item)
+   end loop;
+
+Modify 4.5.2(3.1/4):
+
+If the tested type is tagged, then the tested_simple_expression shall
+resolve to be of a type that is convertible (see 4.6) to the tested
+type; if untagged, the expected type {of}[for] the tested_simple_expression is
+the tested type. The expected type of a choice_simple_expression in a
+membership_choice, and of a simple_expression of a range
+in a membership_choice, is the tested type of the membership operation.
+
 Modify 5.5.2(10.2/5): [This splits it into three parts, and makes other
 changes as noted:]
 
@@ -86,10 +174,79 @@
 enforced; this rule does not apply when a given rule explicitly specifies
 otherwise. 
 
+Modify 12.7(4.5/3):
+
+f a formal_package_association for a formal type T of the template is given
+by <>, then the formal_package_association for any other 
+generic_formal_parameter_declaration of the template that mentions T directly
+or indirectly {shall also}[must] be given by <>[ as well].
+
+
 !discussion
 
 (See !recommendation.)
 
+!corrigendum 4.3.1(17.1/2)
+
+@dinsa
+A @fa<record_component_association> for a discriminant without a
+@fa<default_expression> shall have an @fa<expression> rather than <@>.
+
+@dinss
+A @fa<record_component_association> of the @fa<record_component_association_list>
+of a @fa<record_delta_aggregate> shall not:
+
+@xbullet<use the box compound delimiter <@> rather than an @fa<expression>;>
+
+@xbullet<have an @fa<expression> of a limited type;>
+
+@xbullet<omit the @fa<component_choice_list>; or>
+
+@xbullet<have a @fa<component_choice_list> that is an @b<others> choice.>
+
+For a @fa<record_delta_aggregate>, no two @i<component_>@fa<selector_name>s
+shall denote components declared within different @fa<variant>s of the same
+@fa<variant_part>.
+
+!corrigendum 4.3.3(10)
+
+@drepl
+An @b<others> choice is allowed for an @fa<array_aggregate> only if an
+@i<applicable index constraint> applies to the @fa<array_aggregate>. An 
+applicable index constraint is a constraint provided by certain contexts 
+where an @array_aggregate> is permitted that can be used to determine the 
+bounds of the array value specified by the aggregate. Each of the following
+contexts (and none other) defines an applicable index constraint: 
+@dby
+An @b<others> choice is allowed for an @fa<array_aggregate> only if an
+@i<applicable index constraint> applies to the @fa<array_aggregate>. An 
+applicable index constraint is a constraint provided by certain contexts 
+that can be used to determine the bounds of the array value specified by an 
+@fa<array_aggregate>. Each of the following contexts (and none other) defines
+an applicable index constraint: 
+
+!corrigendum 4.3.5(0)
+
+@dinsc
+See the conflict file for the changes.
+
+!corrigendum 4.5.2(3.1/4)
+
+@drepl
+If the tested type is tagged, then the @i<tested_>@fa<simple_expression> shall
+resolve to be of a type that is convertible (see 4.6) to the tested
+type; if untagged, the expected type for the @i<tested_>@fa<simple_expression> is
+the tested type. The expected type of a @i<choice_>@fa<simple_expression> in a
+@fa<membership_choice>, and of a @fa<simple_expression> of a @fa<range>
+in a @fa<membership_choice>, is the tested type of the membership operation.
+@dby
+If the tested type is tagged, then the @i<tested_>@fa<simple_expression> shall
+resolve to be of a type that is convertible (see 4.6) to the tested
+type; if untagged, the expected type of the @i<tested_>@fa<simple_expression> is
+the tested type. The expected type of a @i<choice_>@fa<simple_expression> in a
+@fa<membership_choice>, and of a @fa<simple_expression> of a @fa<range>
+in a @fa<membership_choice>, is the tested type of the membership operation.
+
 !corrigendum 5.5.2(10/3)
 
 @drepl
@@ -138,6 +295,20 @@
 are not enforced; this rule does not apply when a given rule explicitly
 specifies otherwise. 
 
+!corrigendum 12.7(4.5/3)
+
+@drepl
+@xbullet<If a @fa<formal_package_association> for a formal type @i<T> of the 
+template is given by <@>, then the @fa<formal_package_association> for any 
+other @fa<generic_formal_parameter_declaration> of the template that mentions
+@i<T> directly or indirectly must be given by <@> as well.>
+@dby
+@xbullet<If a @fa<formal_package_association> for a formal type @i<T> of the 
+template is given by <@>, then the @fa<formal_package_association> for any 
+other @fa<generic_formal_parameter_declaration> of the template that mentions
+@i<T> directly or indirectly shall also be given by <@>.>
+
+
 !ASIS
 
 No ASIS effect.
@@ -516,5 +687,118 @@
 In the absence of a transfer of control, the associated parallel construct of 
 a parallel generalized iterator is complete when all of its logical threads of
 control are complete. 
+
+****************************************************************
+
+From the AARM review of Richard Wai, October 2020
+
+4.3.1(17.3/5):
+
+The parenthesized "box" seems unnecessary. In other places, the text simply
+says "<>".
+
+"use the compound delimiter <> [(box)] rather than an expression;"
+
+For an precedent in existing text, see 4.3.3-49.i/3, and new 
+wording 49.k/4 & 4.3.5-26/5
+
+[Editor's response:
+AARM notes don't provide precedent for normative rules, so the only 
+4.3.5(26/5) provides any precedent. Looking for other similar rules:
+   * A similar Legality Rule is 4.3.4(11/5), and that uses "shall not use the
+     box symbol <>".
+   * 12.6(10) just uses "specified by a box" without using <> at all.
+   * 12.7(4.5/3) uses "given by <>" without mentioning box at all.
+So it appears this is an evolving usage without much consistency. Moreover,
+for explanatory text like this, we try to give it exactly once per subclause,
+so precedent isn't necessarily obvious -- the equivalence of <> and "box"
+could be mentioned earlier in the clause.
+
+So I think making the text more like 4.3.4(11/5) would be better, not everyone 
+knows that <> is called box and it doesn't hurt to reiterate it. So perhaps:
+
+"use the box compound delimiter <> rather than an expression;"
+end Editor's response.]
+
+-----
+
+4.3.3(10)
+
+Wording of the "redundant" sentence is extremely pedantic and 
+hard to follow.
+
+Suggestion: "An applicable index constraint is a constraint 
+that can be determined from the context of the aggregate, 
+such as a subtype constraint or target array bounds"
+
+Or something like that..
+
+[Editor's response:
+These sorts of sentences cannot be too sloppy, since they formally *are*
+normative wording (the "redundant" brackets are *not* normative, and since the
+sentence is given in a normative paragraph). I'm dubious about giving examples
+in this sentence given that the formal definition is directly below.
+
+The "where an array_aggregate is permitted part" seems useless and probably is 
+what is confusing you. An array_aggregate is permitted almost everywhere! It's 
+the others choice that isn't allowed in some contexts. And we're talking about 
+array_aggregates; who cares about contexts where they're not allowed! The
+first sentence already mentioned that others choices aren't permitted in some
+contexts, so we don't need to repeat it. So I suggest dropping the "permitted"
+part, giving:
+
+  An applicable index constraint is a constraint provided by certain contexts 
+  that can be used to determine the bounds of the array value specified by an 
+  array_aggregate.
+
+Since this is original Ada 95 wording, it'll go into the presentation AI.
+end Editor's response.]
+
+-----
+
+4.3.5(76/5)
+ 
+The example is pretty suboptimal. The conditional inside the 
+loop is not necessary.
+
+for Item in 1 .. 5 loop
+    Include (S, Item)
+    Include (S, -Item)
+end loop;
+
+This also more closely reflects what will actually happen, 
+and is easier to understand.
+
+[Editor's response:
+I'd probably write this with two loops to reflect what the aggregate actually 
+expands into:
+
+for Item in 1 .. 5 loop
+   Include (S, Item)
+end loop;
+for Item in 1 .. 5 loop
+   Include (S, -Item)
+end loop;
+
+With this expansion, we don't need the "assuming set semantics", either, as 
+this is what is generated.
+
+But I'm not certain whether this really reflects the point that was intended 
+by the author. The previous example already shows the basic expansion. I'm 
+guessing that the intent here was to show that the set would be [-5, -4, -3, 
+-2, -1, 1, 2, 3, 4, 5], but since one can't use aggregate notation to explain 
+how aggregate notation is interpreted (!), he ended up with this. Perhaps it 
+would be better to write:
+
+for Item in 1 .. 5 loop
+   Include (S, Item)
+end loop;
+for Item in -5 .. -1 loop
+   Include (S, Item)
+end loop;
+
+This isn't quite as close to the expansion, but more obviously shows the 
+result than either of the other suggestions.
+end Editor's response.]
 
 ****************************************************************

Questions? Ask the ACAA Technical Agent