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

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

--- ai12s/ai12-0112-1.txt	2018/04/14 05:01:05	1.6
+++ ai12s/ai12-0112-1.txt	2018/07/28 00:35:54	1.7
@@ -1,4 +1,4 @@
-!standard A.18.2(99/3)                                18-03-29    AI12-0112-1/03
+!standard A.18.2(99/3)                                18-07-27    AI12-0112-1/04
 !class Amendment 14-05-15
 !status work item 14-05-15
 !status received 15-02-11
@@ -17,6 +17,10 @@
 We add some additional operations to the containers to use in the
 preconditions and to simplify the needed Global aspects.
+We also add the new aspect Allows_Exit as needed to iterator subprograms
+so that procedural iterators of containers can use the full power of Ada 
+control flow.
 Finally, we added a mechanism to suppress precondition checks for the
 containers; this puts the containers on the same footing as arrays in
 regards to the trade-offs of checking and performance.
@@ -158,7 +162,7 @@
 otherwise  specified. Note that these depend on the formal parameters of the
 package. <<some impl-defed helper packages>> is a placeholder for however we
 decide to deal with helper packages. Note that in the Bounded version, Global
-is just Equal_Element'Global.]
+is just Equal_Element'Global & Element_Type'Global.]
    subtype Extended_Index is
       Index_Type'Base range
@@ -1226,7 +1230,9 @@
 procedure Iterate
   (Container : in Vector;
-   Process   : not null access procedure (Position : in Cursor));
+   Process   : not null access procedure (Position : in Cursor)
+  with Allows_Exit;
 Invokes Process.all with a cursor that designates each element in Container, in
 index order. Tampering with the cursors of Container is prohibited during the
@@ -1237,6 +1243,8 @@
 procedure Reverse_Iterate
   (Container : in Vector;
    Process   : not null access procedure (Position : in Cursor))
+  with Allows_Exit;
 Iterates over the elements in Container as per procedure Iterate, except that
 elements are traversed in reverse index order.
@@ -1668,6 +1676,21 @@
 IO_Check (for the missing Ada.IO package; the packages involved would have to
 be listed), and so on. This provides a bit more granularity (although that
 only matters if we define many more routines with preconditions).
+AI12-0189-1 defines procedural iterators and the Allows_Exit aspect to be 
+used on routines that are prepared to support arbitrary completions caused by 
+the use of transfers of control in the loop body of such an iterator.
+We intend that the Iterate routines defined by the containers can be used by
+such procedural iterators with the full spectrum of transfers-of-control 
+defined by Ada for loops. We indicate that by including Allows_Exit on such
+routines. Including this aspect requires that implementers design the
+Iterate implementations so that they properly clean up even in the face of
+arbitrary completions. That may or may not be true of existing implementations;
+hopefully the new aspect will trigger implementers to inspect their 
+implementations for issues.

Questions? Ask the ACAA Technical Agent