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

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

--- ai12s/ai12-0418-1.txt	2021/01/23 05:57:34	1.5
+++ ai12s/ai12-0418-1.txt	2021/02/27 05:42:03	1.6
@@ -1,5 +1,7 @@
-!standard 4.3.1(17.3/5)                             21-01-20  AI12-0418-1/05
+!standard 4.3.1(17.3/5)                             21-02-26  AI12-0418-1/06
 !standard 4.3.3(10)
+!standard 4.3.5(56/5)
+!standard 4.3.5(57/5)
 !standard 4.3.5(76/5)
 !standard 4.5.2(3.1/4)
 !standard 5.5.2(10.2/5)
@@ -96,7 +98,8 @@
 "the aggregate" with "an array_aggregate".
 
 (7) Replace the single loop with two loops, which is closer to the actual
-expansion.
+expansion. Also, replace Small_Natural with Small_Int (two places), as the
+example uses negative elements.
 
 (8) Replace "for" with "of".
 
@@ -132,6 +135,22 @@
 aggregate]{an array_aggregate}. Each of the following contexts (and none 
 other) defines an applicable index constraint: 
 
+Replace 4.3.5(56/5):
+
+   subtype Small_Natural is Natural range 0..1000;
+
+with:
+
+   subtype Small_Int is Integer range -1000..1000;
+
+Replace 4.3.5(57/5):
+
+   procedure Include (S : in out Set_Type; N : in Small_Natural);
+
+with:
+
+   procedure Include (S : in out Set_Type; N : in Small_Int);
+
 Replace 4.3.5(76/5):
 
    --  Is equivalent (assuming set semantics) to:
@@ -1135,5 +1154,62 @@
    of an entry call is not a possibility).
 
    Perhaps "it may, for example, propagate ...".
+
+****************************************************************
+
+From: Randy Brukardt
+Sent (privately): Wednesday, February 10, 2021 10:55 PM
+
+You might recall that we had a lengthy discussion about the form of the 
+container aggregate example:
+
+  --  A set aggregate consisting of two iterated_element_associations:
+  S := [for Item in 1 .. 5 => Item,
+        for Item in 1 .. 5 => -Item];
+  --  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;
+
+A member of the public just wrote me about this example. He notes that the 
+definition of the Set aggregate is (4.3.5(55-57/5):
+
+   --  Set_Type is a set-like container type.
+   type Set_Type is private
+      with Aggregate => (Empty       => Empty_Set,
+                         Add_Unnamed => Include);
+   function Empty_Set return Set_Type;
+
+   subtype Small_Natural is Natural range 0..1000;
+
+   procedure Include (S : in out Set_Type; N : in Small_Natural);
+
+That is, this is a set of small non-negative integers.
+
+Therefore, any of these forms will raise Constraint_Error, since the set 
+doesn't support negative elements! Thus, this is one of the worst examples 
+ever. :-)
+
+Anyway, we need to decide how to fix this.
+
+The easiest solution is to delete it; its primary purpose is to show that
+one can have an aggregate with more than one iteration, and that doesn't
+seem to be that important (the previous example shows an single iterator).
+There's a lot of examples in this clause, having one less wouldn't matter
+much.
+
+****************************************************************
+
+From: Tucker Taft
+Sent (privately): Thursday, February 11, 2021  8:12 AM
+
+>The easiest solution is to delete it; ...
+
+Alternatively we change "Small_Natural" to be "Small_Int" with range 
+-1000 .. +1000. 
 
 ****************************************************************

Questions? Ask the ACAA Technical Agent