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

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

--- ai12s/ai12-0156-1.txt	2015/06/18 05:56:10	1.5
+++ ai12s/ai12-0156-1.txt	2015/10/09 23:21:19	1.6
@@ -1,6 +1,7 @@
-!standard 5.5.2(2/3)                                  15-02-26  AI05-0156-1/01
+!standard 5.5.2(2/3)                                  15-10-09  AI05-0156-1/02
 !standard 5.5.2(5/4)
 !standard 5.5.2(7/3)
+!standard 3.10.2(11.1/2)
 !class Amendment 15-02-26
 !status work item 15-02-26
 !status received 15-02-13
@@ -86,6 +87,31 @@
 present, the nominal subtype of the loop parameter is the default element
 subtype for the type of the iterable_name.
+Replace AARM 5.5.2(8.a/4) with:
+     The loop parameter of a generalized iterator has the same accessibility
+     as the loop statement. This means that the loop parameter object is
+     finalized when the loop statement is left. (It also may be finalized as
+     part of assigning a new value to the loop parameter.) For array component
+     iterators, the loop parameter directly denotes an element of the array
+     and has the accessibility of the associated array. For container element
+     iterators, the loop parameter denotes the result of the indexing function
+     call (in the case of a constant indexing) or a generalized reference
+     thereof (in the case of a variable indexing). Roughly speaking,
+     the loop parameter has the accessibility level of a single
+     iteration of the loop. More precisely, the function result (or
+     the generalized reference thereof) is considered to be renamed
+     in the declarative part of a notional block statement which
+     immediately encloses the loop's sequence_of_statements;
+     the accessibility of the loop parameter is that of the
+     block statement.
+And add after 3.10.2(11.1/2) as another bulleted list item
+   The accessibility level of an anonymous access type defined
+   by an access_definition of a loop_parameter_subtype_indication
+   is that of the loop parameter.
 For hole 1, we allow anonymous access types for consistency with other
@@ -97,14 +123,20 @@
 for container element iterators, as the Iterator_Element has to be a "name",
 and that does not include anonymous access types.
+We've revised the accessibility rules to cover these anonymous access types.
+We also revised the note describing the accessibility of loop parameters to
+properly explain the container element iterator case, as the old description
+seemed to require the nonsense of keeping the results of the indexing function
+calls until the loop exited (as opposed to just the end of the iteration).
 For hole 2, we allow an optional subtype_indication on a generalized
 iterator. We don't want to force readers to look through many declarations
 to find out the type of a loop parameter. We allow that type to be optional,
-however, as it often is obvious from context. (For instance, if one is
+however, as it often is obvious from context. For instance, if one is
 iterating a language-defined container, everyone should know that the
 cursor type is named Cursor and it's defined in the instance that defines
-the container type.) But that's not true for user-defined iterators, which
+the container type. But that's not true for user-defined iterators, which
 may have been added to existing types for which the name "Cursor" is not

Questions? Ask the ACAA Technical Agent