CVS difference for ai05s/ai05-0139-2.txt
--- ai05s/ai05-0139-2.txt 2011/04/30 07:28:35 1.17
+++ ai05s/ai05-0139-2.txt 2011/06/10 05:58:44 1.18
@@ -1,4 +1,4 @@
-!standard 4.1(2/2) 11-04-26 AI05-0139-2/12
+!standard 4.1(2) 11-06-09 AI05-0139-2/13
!standard 4.1.5(0)
!standard 4.1.6(0)
!standard 5.5(3)
@@ -6,6 +6,8 @@
!standard 5.5.1(0)
!standard 13.3.2(9)
!class Amendment 09-02-13
+!status Amendment 2012 11-06-09
+!status ARG Approved (by Letter Ballot) 9-0-2 11-05-16
!status work item 11-04-26
!status ARG Approved 8-0-0 11-03-17
!status work item 09-02-13
@@ -438,7 +440,7 @@
| character_literal | qualified_expression
{| generalized_reference | generalized_indexing}
-Add a new section 4.1.5:
+Add a new clause 4.1.5:
4.1.5 User-Defined References
@@ -510,7 +512,7 @@
-- Find(C, "abc").Data.all := Element'(...);
-Add a new section 4.1.6:
+Add a new clause 4.1.6:
4.1.6 User-Defined Indexing
@@ -537,7 +539,7 @@
type T'Class). The aspects may not be overridden, but the functions they
denote may be.
- An /indexable type/ is (a view of) a user-defined tagged type with at least
+ An /indexable type/ is (a view of) a tagged type with at least
one of the aspects Constant_Indexing or Variable_Indexing specified. An
/indexable object/ is an object of an indexable type. [Redundant: A
generalized_indexing is a name that denotes the result of calling a
@@ -553,7 +555,7 @@
is any indexable type.
If the Constant_Indexing aspect is specified for the type of the
- /indexable_object_/prefix of a general_indexing, then the general_indexing
+ /indexable_object_/prefix of a generalized_indexing, then the generalized_indexing
is interpreted as a /constant indexing/ under the following circumstances:
* when the Variable_Indexing aspect is not specified for the type
@@ -571,9 +573,9 @@
the name in an object renaming (not inside a primary), unless
there is no Variable_Indexing aspect defined.
- Otherwise, the general_indexing is interpreted as a /variable indexing/.
+ Otherwise, the generalized_indexing is interpreted as a /variable indexing/.
- When a general_indexing is interpreted as a constant (or variable) indexing,
+ When a generalized_indexing is interpreted as a constant (or variable) indexing,
it is equivalent to a call on a prefixed view of one of the functions named
by the Constant_Indexing (or Variable_Indexing) aspect of the type of the
/indexable_object_/prefix with the given actual_parameter_part, and with
@@ -598,7 +600,7 @@
{the iteration_scheme being FOR loop_parameter_specification}, the
loop_parameter_specification is first elaborated. ...
-Add a new section 5.5.1:
+Add two new new clauses 5.5.1 and 5.5.2:
5.5.1 User-Defined Iterator Types
@@ -653,11 +655,11 @@
These aspects are inherited by descendants of type T (including T'Class).
An /iterable type/ is an indexable type with specified Default_iterator and
- Iterator_Element aspects. A /reverse iterable type/ is an
+ 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
- iterable type. A /reverse iterable object/ is an object of a
- reverse iterable type.
+ iterable type. A /reversible iterable object/ is an object of a
+ reversible iterable type.
Legality Rules
@@ -726,9 +728,10 @@
container element iterator shall cover the default element type for
the type of the /iterable_/name.
- In a container element iterator, if the /iterable_/name denotes a
- constant, then the Constant_Indexing aspect shall be specified for
- the type of the /iterable_/name.
+ In a container element iterator whose /iterable_/name has type T,
+ if the /iterable_/name denotes a constant or the Variable_Indexing
+ aspect is not specified for T, then the Constant_Indexing aspect
+ shall be specified for T.
Static Semantics
@@ -744,6 +747,7 @@
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
@@ -807,7 +811,7 @@
for the loop, with the only parameter to the indexing being the
current value of the loop cursor; then the Next operation of the
iterator type is called with the loop iterator and the loop cursor to
- produce the next value to be assigned to the loop cursor. This
+ produce the next value to be assigned to the loop cursor. This
repeats until the result of calling Has_Element on the loop cursor is
False, or until the loop is left as a consequence of a transfer of control.
For a reverse container element iterator, the operations Last and Previous
@@ -833,8 +837,477 @@
See AI05-0212-1 for examples of these features being used in the predefined
containers packages.
+!corrigendum 4.1(2)
+
+@drepl
+@xcode<@fa<name> ::=
+ @fa<direct_name> | @fa<explicit_dereference>
+ | @fa<indexed_component> | @fa<slice>
+ | @fa<selected_component> | @fa<attribute_reference>
+ | @fa<type_conversion> | @fa<function_call>
+ | @fa<character_literal>>
+@dby
+@xcode<@fa<name> ::=
+ @fa<direct_name> | @fa<explicit_dereference>
+ | @fa<indexed_component> | @fa<slice>
+ | @fa<selected_component> | @fa<attribute_reference>
+ | @fa<type_conversion> | @fa<function_call>
+ | @fa<character_literal>
+ | @fa<generalized_reference> | @fa<generalized_indexing>>
+
+
+!corrigendum 4.1.5(0)
+
+@dinsc
+
+@s8<@i<Static Semantics>>
+
+Given a discriminated type @i<T>, the following type-related operational aspect
+may be specified:
+
+@xhang<@xterm<Implicit_Dereference>This aspect is specified by a name that denotes
+an access discriminant declared for the type @i<T>.>
+
+A (view of a) type with a specified Implicit_Dereference aspect is a
+@i<reference type>. A @i<reference object> is an object of a reference type.
+The discriminant named by the Implicit_Dereference aspect is the
+@i<reference discriminant> of the reference type or reference object.
+A @fa<generalized_reference> is a @fa<name> that identifies a
+reference object, and denotes the object or subprogram designated by
+the reference discriminant of the reference object.
+
+@s8<@i<Syntax>>
+
+@xindent<@fa<generalized_reference> ::= @i<reference_object_>@fa<name>>
+
+@s8<@i<Name Resolution>>
+
+The expected type for the @i<reference_object_>@fa<name> in a @fa<generalized_reference>
+is expected to be of any reference type.
+
+@s8<@i<Static Semantics>>
+
+A @fa<generalized_reference> denotes a view equivalent to that of a dereference
+of the reference discriminant of the reference object.
+
+Given a reference type @i<T>, the Implicit_Dereference aspect is inherited
+by descendants of type @i<T> if not overridden. If a descendant type
+constrains the value of the reference discriminant of @i<T> by a new
+discriminant, that new discriminant is the reference discriminant of
+the descendant. If the descendant type constrains the value of the
+reference discriminant of @i<T> by an @fa<expression> other than the @fa<name> of a
+new discriminant, a @fa<generalized_reference> that identifies an object of
+the descendant type denotes the object or subprogram designated by the
+value of this constraining expression.
+
+@s8<@i<Dynamic Semantics>>
+
+The evaluation of a @fa<generalized_reference> consists of the evaluation
+of the @i<reference_object_>@fa<name> and a determination of the object or
+subprogram designated by the reference discriminant of the named
+reference object. A check is made that the value of the reference
+discriminant is not the null access value. Constraint_Error is raised
+if this check fails. The @fa<generalized_reference> denotes the object or
+subprogram designated by the value of the reference discriminant of the
+named reference object.
+
+@s8<@i<Examples>>
+
+@xcode<@b<type> Ref_Element(Data : @b<access> Element) @b<is>
+ @b<new> Ada.Finalization.Limited_Controlled @b<with private>
+ @b<with> Implicit_Dereference =@> Data;
+ -- @ft<@i<This Ref_Element type is a "reference" type.>>
+ -- @ft<@i<"Data" is its reference discriminant.>>>
+
+@xcode<@b<function> Find(C : @b<access> Container; Key : String) @b<return> Ref_Element;
+ -- @ft<@i<Return a reference to an element of a container>>>
+
+@xcode<...>
+
+@xcode<Find(C, "abc") := Element'(...); -- @ft<@i<Assign through a reference.>>>
+
+@xcode<-- @ft<@i<This is equivalent to:>>
+-- Find(C, "abc").Data.@b<all> := Element'(...);>
+
+
+!corrigendum 4.1.6(0)
+
+@dinsc
+
+@s8<@i<Static Semantics>>
+
+Given a tagged type @i<T>, the following type-related, operational aspects
+may be specified:
+
+@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
+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
+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.>
+
+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
+denote may be.
+
+An @i<indexable type> is (a view of) a tagged type with at least
+one of the aspects Constant_Indexing or Variable_Indexing specified. An
+@i<indexable object> is an object of an indexable type. A
+@fa<generalized_indexing> is a @fa<name> that denotes the result of calling a
+function named by a Contant_Indexing or Variable_Indexing aspect.
+
+@s8<@i<Syntax>>
+
+@xindent<@fa<generalized_indexing> ::= @i<indexable_object_>@fa<prefix> @fa<actual_parameter_part>>
+
+@s8<@i<Name Resolution>>
+
+The expected type for the @i<indexable_object_>@fa<prefix> of a @fa<generalized_indexing>
+is any indexable type.
+
+If the Constant_Indexing aspect is specified for the type of the
+@i<indexable_object_>@fa<prefix> of a @fa<generalized_indexing>, then the
+@fa<generalized_indexing> is interpreted as a @i<constant indexing> under the
+following circumstances:
+
+@xbullet<when the Variable_Indexing aspect is not specified for the type
+of the @i<indexable_object_>@fa<prefix>;>
+
+@xbullet<when the @i<indexable_object_>@fa<prefix> denotes a constant;>
+
+@xbullet<when the @fa<generalized_indexing> is used within a @fa<primary>
+where a @fa<name> denoting a constant is permitted.>
+
+Otherwise, the @fa<generalized_indexing> is interpreted as a @i<variable indexing>.
+
+When a generalized_indexing is interpreted as a constant (or variable) indexing,
+it is equivalent to a call on a prefixed view of one of the functions named
+by the Constant_Indexing (or Variable_Indexing) aspect of the type of the
+@i<indexable_object_>@fa<prefix> with the given @fa<actual_parameter_part>, and with
+the @i<indexable_object_>@fa<prefix> as the @fa<prefix> of the prefixed view.
+
+!corrigendum 5.5(3)
+
+@drepl
+@xcode<@fa<iteration_scheme> ::= @ft<@b<while>> @fa<condition>
+ | @ft<@b<for>> @fa<loop_parameter_specification>>
+@dby
+@xcode<@fa<iteration_scheme> ::= @ft<@b<while>> @fa<condition>
+ | @ft<@b<for>> @fa<loop_parameter_specification>
+ | @ft<@b<for>> @fa<iterator_specification>>
+
+!corrigendum 5.5(9)
+
+@drepl
+For the execution of a @fa<loop_statement> with a @b<for> @fa<iteration_scheme>,
+the @fa<loop_parameter_specification> is first elaborated. This
+elaboration creates the loop parameter and elaborates the
+@fa<discrete_subtype_definition>.
+If the @fa<discrete_subtype_definition> defines a subtype with a null range,
+the execution of the @fa<loop_statement> is complete. Otherwise, the
+@fa<sequence_of_statements> is executed once for each value of the
+discrete subtype defined by the @fa<discrete_subtype_definition> (or until
+the loop is left as a consequence of a transfer of control).
+Prior to each such iteration,
+the corresponding value of the discrete subtype is assigned to the
+loop parameter. These values are assigned in increasing order unless
+the reserved word @b<reverse> is present, in which case the values
+are assigned in decreasing order.
+@dby
+For the execution of a @fa<loop_statement> with the @fa<iteration_scheme>
+being @b<for> @fa<loop_parameter_specification>,
+the @fa<loop_parameter_specification> is first elaborated. This
+elaboration creates the loop parameter and elaborates the
+@fa<discrete_subtype_definition>.
+If the @fa<discrete_subtype_definition> defines a subtype with a null range,
+the execution of the @fa<loop_statement> is complete. Otherwise, the
+@fa<sequence_of_statements> is executed once for each value of the
+discrete subtype defined by the @fa<discrete_subtype_definition> (or until
+the loop is left as a consequence of a transfer of control).
+Prior to each such iteration,
+the corresponding value of the discrete subtype is assigned to the
+loop parameter. These values are assigned in increasing order unless
+the reserved word @b<reverse> is present, in which case the values
+are assigned in decreasing order.
+
+
+!corrigendum 5.5.1(0)
+
+@dinsc
+
+@s8<@i<Static Semantics>>
+
+The following language-defined generic library package exists:
+
+@xcode<@b<generic>
+ @b<type> Cursor;
+ @b<with function> Has_Element (Position : Cursor) @b<return> Boolean;
+@b<package> Ada.Iterator_Interfaces @b<is>
+ @b<pragma> Pure (Iterator_Interfaces);>
+
+@xcode< @b<type> Forward_Iterator @b<is limited interface>;
+ @b<function> First (Object : Forward_Iterator) @b<return> Cursor @b<is abstract>;
+ @b<function> Next (Object : Forward_Iterator; Position : Cursor) @b<return> Cursor
+ @b<is abstract>;>
+
+@xcode< type Reversible_Iterator @b<is limited interface and> Forward_Iterator;
+ @b<function> Last (Object : Reversible_Iterator) @b<return> Cursor @b<is abstract>;
+ @b<function> Previous (Object : Reversible_Iterator; Position : Cursor) @b<return> Cursor
+ @b<is abstract>;>
+
+@xcode<@b<end> Ada.Iterator_Interfaces;>
+
+
+An @i<iterator type> is a type descended from the Forward_Iterator interface
+from some instance of Ada.Iterator_Interfaces. A @i<reversible iterator type>
+is a type descended from the Reversible_Iterator interface from some instance
+of Ada.Iterator_Interfaces. An @i<iterator object> is an object of an iterator
+type. A @i<reversible iterator object> is an object of a reversible iterator
+type. The formal subtype Cursor from the associated instance of
+Ada.Iterator_Interfaces is the @i<iteration cursor subtype> for the iterator
+type.
+
+The following type-related operational aspects may be specified
+for an indexable type @i<T> (see 4.1.6):
+
+@xhang<@xterm<Default_Iterator>This aspect is specified by a @fa<name> that denotes
+exactly one function declared immediately within the same
+declaration list in which @i<T> is declared, whose first parameter is
+of type @i<T> or @i<T>'Class or an access parameter whose designated type
+is type @i<T> or @i<T>'Class, whose other parameters, if any, have
+default expressions, and whose result type is an iterator type.
+This function is the @i<default iterator function> for @i<T>. Its
+result subtype is the @i<default iterator subtype> for T. The
+iteration cursor subtype for the default iterator subtype is the
+@i<default cursor subtype> for @i<T>.>
+
+@xhang<@xterm<Iterator_Element>This aspect is specified by a @fa<name> that denotes
+a subtype. This is the @i<default element subtype> for @i<T>.>
+
+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
+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
+iterable type. A @i<reversible iterable object> is an object of a
+reversible iterable type.
+
+@s8<@i<Legality Rules>>
+
+The Constant_Indexing aspect (if any) of an iterable type @i<T>
+shall denote exactly one function with the following properties:
+
+@xbullet<the result type of the function is covered by
+the default element type of @i<T> or is a reference type
+(see 4.1.5) with an access discriminant designating
+a type covered by the default element type of @i<T>;>
+
+@xbullet<the type of the second parameter of the function covers the
+default cursor type for @i<T>;>
+
+@xbullet<if there are more than two parameters, the additional
+parameters all have default expressions.>
+
+This function (if any) is the @i<default constant indexing function>
+for @i<T>.
+
+The Variable_Indexing aspect (if any) of an iterable type @i<T>
+shall denote exactly one function with the following properties:
+
+@xbullet<the result type of the function is a reference type
+(see 4.1.5) with an access discriminant designating
+a type covered by the default element type of @i<T>;>
+
+@xbullet<the type of the second parameter of the function covers the
+default cursor type for @i<T>;>
+
+@xbullet<if there are more than two parameters, the additional
+parameters all have default expressions.>
+
+This function (if any) is the @i<default variable indexing function>
+for @i<T>.
+
+!corrigendum 5.5.2(0)
+
+@dinsc
+
+Generalized forms of loop iteration are provided by an @fa<iterator_specification>.
+
+@s8<@i<Syntax>>
+
+@xcode<@fa<iterator_specification ::=>
+ @fa<defining_identifier> @ft<@b<in>> [@ft<@b<reverse>>] @ft<@i<iterator_>>@fa<name>
+ | @fa<defining_identifier [: subtype_indication]> @ft<@b<of>> [@ft<@b<reverse>>] @ft<@i<array_>>@fa<name>
+ | @fa<defining_identifier [: subtype_indication]> @ft<@b<of>> [@ft<@b<reverse>>] @ft<@i<iterable_>>@fa<name>>
+
+@s8<@i<Name Resolution>>
+
+The first form of @fa<iterator_specification> is called a @i<generalized
+iterator>; the expected type for the @i<iterator_>@fa<name> is any iterator
+type. The second form of @fa<iterator_specification> is called an @i<array
+component iterator>; the expected type for the @i<array_>@fa<name> is any
+array type. The third form of @fa<iterator_specification> is called a
+@i<container element iterator>; the expected type for the
+@i<iterable_>@fa<name> is any iterable type.
+
+@s8<@i<Legality Rules>>
+
+If the reserved word @b<reverse> appears, the @fa<iterator_specification> is a
+@i<reverse iterator>; otherwise it is a @i<forward iterator>. In a
+reverse generalized iterator, the @i<iterator_>@fa<name> shall be of a
+reversible iterator type. In a reverse container element iterator,
+the default iterator type for the type of the @i<iterable_>@fa<name> shall
+be a reversible iterator type.
+
+The type of the @fa<subtype_indication>, if any, of an array component
+iterator shall cover the component type of the type of the
+@i<array_>@fa<name>. The type of the @fa<subtype_indication>, if any, of a
+container element iterator shall cover the default element type for
+the type of the @i<iterable_>@fa<name>.
+
+In a container element iterator whose @i<iterable_>@fa<name> has
+type @i<T>, if the @i<iterable_>@fa<name> denotes a
+constant or the Variable_Indexing aspect is not specified for @i<T>,
+then the Constant_Indexing aspect shall be specified for @i<T>.
+
+@s8<@i<Static Semantics>>
+
+An @fa<iterator_specification> declares a @i<loop parameter>. In a
+generalized iterator, the nominal subtype of the loop parameter is
+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
+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
+@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
+if the @i<array_>@fa<name> denotes a constant; otherwise it denotes a
+variable. In a container element iterator, the loop parameter denotes
+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.
+
+@s8<@i<Dynamic Semantics>>
+
+For the execution of a @fa<loop_statement> with an @fa<iterator_specification>,
+the @fa<iterator_specification> is first elaborated. This elaboration
+elaborates the @fa<subtype_indication>, if any.
+
+For a generalized iterator, the loop parameter is created, and the
+@i<iterator_>@fa<name> is evaluated and the denoted iterator object becomes
+the @i<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
+Has_Element on the initial value is False, then the execution of the
+@fa<loop_statement> is complete. Otherwise, the @fa<sequence_of_statements>
+is executed and then the Next operation of the iterator type is called with
+the loop iterator and the current value of the loop parameter to produce the
+next value to be assigned to the loop parameter. This repeats until
+the result of calling Has_Element on the loop parameter is False,
+or the loop is left as a consequence of a transfer of control. For a
+reverse generalized iterator, the operations Last and Previous are
+called rather than First and Next.
+
+For an array component iterator, the @i<array_>@fa<name> is evaluated and
+the array object denoted by the name becomes the @i<array for the
+oop>. If the array for the loop is a null array, then the execution
+of the @fa<loop_statement> is complete. Otherwise, the
+@fa<sequence_of_statements> is executed with the loop parameter denoting
+each component of the array for the loop, using a @i<canonical> order
+of components, which is last dimension varying fastest (unless the
+array has convention Fortran, in which case it is first dimension
+varying fastest). For a forward array component iterator, the iteration
+starts with the component whose index values are each the first in their
+index range, and continues in the canonical order. For a reverse array
+component iterator, the iteration starts with the component whose index
+values are each the last in their index range, and continues in the reverse
+of the canonical order. The loop iteration proceeds until the
+@fa<sequence_of_statements> has been executed for each component of the
+array for the loop, or until the loop is left as a consequence of a
+transfer of control.
+
+For a container element iterator, the @i<iterable_>@fa<name> is evaluated
+and the iterable object denoted by the name becomes the @i<iterable
+object for the loop>. The default iterator function for the type of
+the iterable object for the loop is called on the iterable object
+and the result is the @i<loop iterator>. An object of the default
+cursor subtype is created (the @i<loop cursor>).
+
+For a forward container element iterator, the operation First of the
+iterator type is called on the loop iterator, to produce the initial
+value for the loop cursor. If the result of calling Has_Element on
+the initial value is False, then the execution of the @fa<loop_statement>
+is complete. Otherwise, the @fa<sequence_of_statements> is executed with the
+loop parameter denoting an indexing (see 4.1.6) into the iterable object
+for the loop, with the only parameter to the indexing being the
+current value of the loop cursor; then the Next operation of the
+iterator type is called with the loop iterator and the loop cursor to
+produce the next value to be assigned to the loop cursor. This
+repeats until the result of calling Has_Element on the loop cursor is
+False, or until the loop is left as a consequence of a transfer of control.
+For a reverse container element iterator, the operations Last and Previous
+are called rather than First and Next. If the loop parameter is a
+constant (see above), then the indexing uses the default constant
+indexing function for the type of the iterable object for the loop;
+otherwise it uses the default variable indexing function.
+
+
+!corrigendum 13.13.2(9/2)
+
+@drepl
+For elementary types, Read reads (and Write writes) the number of stream
+elements implied by the Stream_Size for the type @i<T>; the representation of
+those stream elements is implementation defined.
+For composite types, the Write or Read attribute for
+each component is called in canonical order, which is last dimension varying
+fastest for an array, and positional aggregate order for a record. Bounds are
+not included in the stream if @i<T> is an array type. If @i<T> is a
+discriminated type, discriminants are included only if they have defaults.
+If @i<T> is a tagged type, the tag is not included. For type extensions, the
+Write or Read attribute for the parent type is called, followed by the Write
+or Read attribute of each component of the extension part, in canonical order.
+For a limited type extension, if the attribute of the parent type or any
+progenitor type of @i<T> is available anywhere within the immediate scope of
+@i<T>, and the attribute of the parent type or the type of any of the extension
+components is not available at the freezing point of @i<T>, then the attribute
+of @i<T> shall be directly specified.
+@dby
+For elementary types, Read reads (and Write writes) the number of stream
+elements implied by the Stream_Size for the type @i<T>; the representation of
+those stream elements is implementation defined.
+For composite types, the Write or Read attribute for
+each component is called in canonical order, which is last dimension varying
+fastest for an array (unless the convention of the array is
+Fortran, in which case it is first dimension varying fastest),
+and positional aggregate order for a record. Bounds are
+not included in the stream if @i<T> is an array type. If @i<T> is a
+discriminated type, discriminants are included only if they have defaults.
+If @i<T> is a tagged type, the tag is not included. For type extensions, the
+Write or Read attribute for the parent type is called, followed by the Write
+or Read attribute of each component of the extension part, in canonical order.
+For a limited type extension, if the attribute of the parent type or any
+progenitor type of @i<T> is available anywhere within the immediate scope of
+@i<T>, and the attribute of the parent type or the type of any of the extension
+components is not available at the freezing point of @i<T>, then the attribute
+of @i<T> shall be directly specified.
+
!ACATS test
+ACATS tests are needed for all of these features.
!appendix
@@ -4025,3 +4498,66 @@
****************************************************************
+From: Tucker Taft
+Sent: Monday, May 2, 2011 9:44 PM
+
+[Part of this message that pertains to this AI.]
+
+AI05-0139-2/12 Syntactic sugar for accessors, containers, and iterators
+ [The only change is to the form of the Iterator_Interfaces generic and the associated
+ wording and examples. This generic now uses a formal incomplete type.]
+ Approve __X____ Disapprove ______ Abstain _______
+ Comments:
+ There are several places where "general_indexing" should be
+ "generalized_indexing."
+
+****************************************************************
+
+From: Randy Brukardt
+Sent: Thursday, June 9, 2011 10:04 PM
+
+The text in 4.1.6 User-defined Indexing says in part:
+
+An /indexable type/ is (a view of) a user-defined tagged type with at least one of the
+aspects Constant_Indexing or Variable_Indexing specified. ...
+
+Why does this say "user-defined"? Taken literally, that would mean that the type Vector
+in Ada.Containers.Vectors is not an indexable type, since it is not "user-defined".
+That's surely not what we want! (And I'm sure Adam will ask soon if unchanged.)
+
+I note that 4.1.5 (User-defined References) doesn't say anything about "user-defined"
+in the similar text. So I conclude this is just a mistake.
+Right??
+
+****************************************************************
+
+From: Randy Brukardt
+Sent: Thursday, June 9, 2011 11:13 PM
+
+In 5.5.2 (generalized iterators), we have:
+
+ In a container element iterator, if the /iterable_/name denotes a
+ constant, then the Constant_Indexing aspect shall be specified for
+ the type of the /iterable_/name.
+
+This rule is weird, because it says nothing about Variable_Indexing. If the name denotes
+a variable, there are no requirements for any indexing aspect to be specified, which is
+not going to work.
+
+We need at least one of the two aspects specified for the type, and if the object is a
+constant, it has to be Constant_Indexing. (If the object is a variable, it can be either
+Variable_Indexing or Constant_Indexing.)
+
+So I replaced this paragraph by the following:
+
+ In a container element iterator whose /iterable_/name has type T,
+ if the /iterable_/name denotes a constant or the Variable_Indexing
+ aspect is not specified for T, then the Constant_Indexing aspect
+ shall be specified for T.
+
+I introduced the name "T" to avoid having to say "type of the /iterable_/name" twice
+close together.
+
+Perhaps this can be worded more elegantly.
+
+****************************************************************
Questions? Ask the ACAA Technical Agent