CVS difference for ai05s/ai05-0139-2.txt

Differences between 1.20 and version 1.21
Log of other versions for file ai05s/ai05-0139-2.txt

--- ai05s/ai05-0139-2.txt	2011/08/17 00:24:11	1.20
+++ ai05s/ai05-0139-2.txt	2011/09/29 06:34:02	1.21
@@ -1,9 +1,10 @@
-!standard 4.1(2)                                      11-06-09  AI05-0139-2/13
+!standard 4.1(2)                                      11-09-26  AI05-0139-2/14
 !standard 4.1.5(0)
 !standard 4.1.6(0)
 !standard 5.5(3)
 !standard 5.5(9)
 !standard 5.5.1(0)
+!standard 5.5.2(0)
 !standard 13.3.2(9)
 !class Amendment 09-02-13
 !status Amendment 2012 11-06-09
@@ -521,22 +522,22 @@
 
   Constant_Indexing  This aspect shall be specified by a name that
     denotes one or more functions declared immediately within the same
-    declaration list in which T is declared. All of such functions shall
+    declaration list in which T is declared. All such functions shall
     have at least two parameters, the first of which is of type T or
     T'Class, or is an access-to-constant parameter with designated type
     T or T'Class.
 
   Variable_Indexing  This aspect shall be specified by a name that
     denotes one or more functions declared immediately within the same
-    declaration list in which T is declared. All of such functions shall
+    declaration list in which T is declared. All such functions shall
     have at least two parameters, the first of which is of type T or
     T'Class, or is an access parameter with designated type T or T'Class.
     All of such functions shall have a return type that is a reference
-    type (see 4.1.5), whose access discriminant is of an
+    type (see 4.1.5), whose reference discriminant is of an
     access-to-variable type.
 
   These aspects are inherited by descendants of T (including the class-wide
-  type T'Class). The aspects may not be overridden, but the functions they
+  type T'Class). The aspects shall not be overridden, but the functions they
   denote may be.
 
   An /indexable type/ is (a view of) a tagged type with at least
@@ -545,6 +546,26 @@
   generalized_indexing is a name that denotes the result of calling a
   function named by a Constant_Indexing or Variable_Indexing aspect.]
 
+            Legality Rules
+
+  The Constant_Indexing or Variable_Indexing aspect shall not be specified:
+
+  * on a derived type if the parent type has the corresponding aspect specified
+    or inherited; or
+  * on a full_type_declaration if the type has a tagged partial view.
+
+  In addition to the places where Legality Rules normally apply (see 12.3),
+  these rules apply also in the private part of an instance of a generic unit.
+
+    AARM Ramification: In order to enforce these rules without breaking privacy,
+    we cannot allow a tagged private type to have hidden indexing aspects. There
+    is no problem if the private type is not tagged (as the indexing aspects
+    cannot be specified on descendants in that case).
+
+    We don't need an assume-the-worst rule as deriving from formal tagged
+    types is not allowed in generic bodies.
+    End AARM Ramification.
+
             Syntax
 
   generalized_indexing ::= /indexable_object_/prefix actual_parameter_part
@@ -654,7 +675,7 @@
 
    These aspects are inherited by descendants of type T (including T'Class).
 
-   An /iterable type/ is an indexable type with specified Default_iterator and
+   An /iterable type/ is an indexable type with specified Default_Iterator and
    Iterator_Element aspects. A /reversible iterable type/ is an
    iterable type with the default iterator type being a reversible
    iterator type. An /iterable object/ is an object of an
@@ -740,20 +761,20 @@
    the iterator cursor subtype. In an array component iterator or a
    container element iterator, if a subtype_indication is present, it
    determines the nominal subtype of the loop parameter. In an array
-   component iterator if a subtype_indication is not present, the
+   component iterator, if a subtype_indication is not present, the
    nominal subtype of the loop parameter is the component subtype of the
-   type of the /array_/name. In a container element iterator if a
+   type of the /array_/name. In a container element iterator, if a
    subtype_indication is not present, the nominal subtype of the loop
    parameter is the default element subtype for the type of the
    /iterable_/name.
 
-   In a generalized iterator, the loop parameter denotes a constant.
-   In an array component iterator, the loop parameter denotes a constant
-   if the /array_/name denotes a constant; otherwise it denotes a
-   variable. In a container element iterator, the loop parameter denotes
+   In a generalized iterator, the loop parameter is a constant.
+   In an array component iterator, the loop parameter is a constant
+   if the /array_/name denotes a constant; otherwise it is a
+   variable. In a container element iterator, the loop parameter is
    a constant if the /iterable_/name denotes a constant, or if the
    Variable_Indexing aspect is not specified for the type of the
-   /iterable_/name; otherwise it denotes a variable.
+   /iterable_/name; otherwise it is a variable.
 
             Dynamic Semantics
 
@@ -761,8 +782,8 @@
    the iterator_specification is first elaborated. This elaboration
    elaborates the subtype_indication, if any.
 
-   For a generalized iterator, the loop parameter is created, and the
-   /iterator_/name is evaluated and the denoted iterator object becomes
+   For a generalized iterator, the loop parameter is created, the
+   /iterator_/name is evaluated, and the denoted iterator object becomes
    the /loop iterator/. In a forward generalized iterator, the operation
    First of the iterator type is called on the loop iterator, to produce
    the initial value for the loop parameter. If the result of calling
@@ -941,21 +962,21 @@
 
 @xhang<@xterm<Constant_Indexing>This aspect shall be specified by a @fa<name> that
 denotes one or more functions declared immediately within the same
-declaration list in which @i<T> is declared. All of such functions shall
+declaration list in which @i<T> is declared. All such functions shall
 have at least two parameters, the first of which is of type @i<T> or
 @i<T>'Class, or is an access-to-constant parameter with designated type
 @i<T> or @i<T>'Class.>
 
 @xhang<@xterm<Variable_Indexing>This aspect shall be specified by a @fa<name> that
 denotes one or more functions declared immediately within the same
-declaration list in which @i<T> is declared. All of such functions shall
+declaration list in which @i<T> is declared. All such functions shall
 have at least two parameters, the first of which is of type @i<T> or
 @i<T>'Class, or is an access parameter with designated type @i<T> or @i<T>'Class.
 All of such functions shall have a return type that is a reference
-type (see 4.1.5), whose access discriminant is of an access-to-variable type.>
+type (see 4.1.5), whose reference discriminant is of an access-to-variable type.>
 
 These aspects are inherited by descendants of @i<T> (including the class-wide
-type @i<T>'Class). The aspects may not be overridden, but the functions they
+type @i<T>'Class). The aspects shall not be overridden, but the functions they
 denote may be.
 
 An @i<indexable type> is (a view of) a tagged type with at least
@@ -964,6 +985,18 @@
 @fa<generalized_indexing> is a @fa<name> that denotes the result of calling a
 function named by a Constant_Indexing or Variable_Indexing aspect.
 
+@s8<@i<Legality Rules>>
+
+The Constant_Indexing or Variable_Indexing aspect shall not be specified:
+
+@xbullet<on a derived type if the parent type has the corresponding aspect
+specified or inherited; or>
+
+@xbullet<on a @fa<full_type_declaration> if the type has a tagged partial view.>
+
+In addition to the places where Legality Rules normally apply (see 12.3), these
+rules apply also in the private part of an instance of a generic unit.
+
 @s8<@i<Syntax>>
 
 @xindent<@fa<generalized_indexing> ::= @i<indexable_object_>@fa<prefix> @fa<actual_parameter_part>>
@@ -1094,7 +1127,7 @@
 
 These aspects are inherited by descendants of type @i<T> (including @i<T>'Class).
 
-An @i<iterable type> is an indexable type with specified Default_iterator and
+An @i<iterable type> is an indexable type with specified Default_Iterator and
 Iterator_Element aspects. A @i<reversible iterable type> is an
 iterable type with the default iterator type being a reversible
 iterator type. An @i<iterable object> is an object of an
@@ -1186,17 +1219,17 @@
 the iterator cursor subtype. In an array component iterator or a
 container element iterator, if a @fa<subtype_indication> is present, it
 determines the nominal subtype of the loop parameter. In an array
-component iterator if a @fa<subtype_indication> is not present, the
+component iterator, if a @fa<subtype_indication> is not present, the
 nominal subtype of the loop parameter is the component subtype of the
-type of the @i<array_>@fa<name>. In a container element iterator if a
+type of the @i<array_>@fa<name>. In a container element iterator, if a
 @fa<subtype_indication> is not present, the nominal subtype of the loop
 parameter is the default element subtype for the type of the
 @i<iterable_>@fa<name>.
 
-In a generalized iterator, the loop parameter denotes a constant.
-In an array component iterator, the loop parameter denotes a constant
+In a generalized iterator, the loop parameter is a constant.
+In an array component iterator, the loop parameter is a constant
 if the @i<array_>@fa<name> denotes a constant; otherwise it denotes a
-variable. In a container element iterator, the loop parameter denotes
+variable. In a container element iterator, the loop parameter is
 a constant if the @i<iterable_>@fa<name> denotes a constant, or if the
 Variable_Indexing aspect is not specified for the type of the
 @i<iterable_>@fa<name>; otherwise it denotes a variable.

Questions? Ask the ACAA Technical Agent