CVS difference for ai05s/ai05-0262-1.txt
--- ai05s/ai05-0262-1.txt 2011/11/09 03:33:03 1.7
+++ ai05s/ai05-0262-1.txt 2011/12/17 02:10:47 1.8
@@ -1,8 +1,18 @@
-!standard 1.1.2(23) 11-10-26 AI05-0262-1/04
+!standard 1.1.2(23) 11-12-15 AI05-0262-1/05
+!standard 1.1.4(14.1/2)
+!standard 2.1(4/2)
+!standard 2.1(13/2)
+!standard 2.1(14/2)
+!standard 2.2(2/2)
+!standard 2.2(5/2)
!standard 3.1(1)
!standard 3.2.4(0)
!standard 3.3(19)
!standard 3.5(30/2)
+!standard 3.5.2(2/3)
+!standard 3.5.2(3/2)
+!standard 3.5.2(3.1/2)
+!standard 3.5.2(3.2/2)
!standard 3.8.1(10)
!standard 3.8.1(11)
!standard 3.8.1(15)
@@ -45,12 +55,14 @@
!standard A.18.1(7/2)
!standard A.18.2(88/2)
!standard A.18.2(147/2)
+!standard A.18.2(230/2)
!standard A.18.2(231/2)
!standard A.18.2(251/2)
!standard A.18.2(254/2)
!standard A.18.3(60/2)
!standard A.18.3(88/2)
!standard A.18.3(102/2)
+!standard A.18.3(144/2)
!standard A.18.3(145/2)
!standard A.18.3(156/2)
!standard A.18.3(159/2)
@@ -58,20 +70,25 @@
!standard A.18.4(43/2)
!standard A.18.4(79/2)
!standard A.18.4(82/2)
+!standard A.18.6(46/2)
!standard A.18.6(58/2)
!standard A.18.6(74/2)
+!standard A.18.6(94/2)
!standard A.18.7(18/2)
!standard A.18.7(38/2)
!standard A.18.7(100/2)
!standard A.18.7(103/2)
+!standard A.18.9(61/2)
!standard A.18.9(81/2)
!standard A.18.9(93/2)
+!standard A.18.9(113/2)
!standard A.18.10(0)
!standard A.18.18(0)
!standard A.18.26(5/2)
!standard A.18.26(9/2)
!standard A.18.27(0)
!standard A.18.30(0)
+!standard B(1)
!standard B.2(10.1/2)
!standard B.3(2/2)
!standard C.7.1(14)
@@ -81,6 +98,7 @@
!standard H.4(8/1)
!class presentation 11-07-27
!status Amendment 2012 11-07-27
+!status ARG Approved 9-0-0 11-12-11
!status work item 11-07-27
!status received 11-07-21
!priority Medium
@@ -109,8 +127,25 @@
* Annex Q, "Language-Defined Entities"
+Modify 1.1.4(14.1/3), 2.2(2/2), 2.2(5/2), 3.5.2(3.2/2):
+
+"...whose code [position]{point} is ..."
+
+Modify 2.1(4/3), 2.1(14/2):
+
+"...whose relative code [position]{point} ..."
+
+Modify 2.1(13/2):
+
+"...whose code [positions] {points} ..."
+
+
Add "access" to the list of anonymous types in 3.3.1(1).
+Modify 3.2.4(12/3):
+
+"...where [both operands are]{each operand is} predicate-static; or"
+
Add after 3.2.4(14/3):
A predicate shall not be specified for an incomplete subtype.
@@ -143,6 +178,14 @@
In 3.5(30/3), "sequence of character" should be "sequence of graphic characters".
[This is the wording used in 'Image, this should be the same.]
+Modify 3.5(56/3):
+
+"...with a code [position] {point} smaller ..."
+
+Modify 3.5.2(2/3, 3/2, 3.1/2):
+
+"...code [positions]{points} of..."
+
Move the second sentence of 3.2.4(19/3) to after 3.2.4(16/3), and make it plural. Delete the second
line of the AARM note after 3.2.4(19/3).
@@ -289,8 +332,10 @@
Modify 6.1.1(29/3):
-"...subprogram {or entry}. {An exception raised by the evaluation of a precondition
-or postcondition expression is also raised at the point of call.}"
+If a precondition or postcondition check fails, the exception is raised at the point of the
+call[. The]{; the }exception cannot be handled inside the called subprogram{ or entry}.
+{Similarly, any exception raised by the evaluation of a precondition or postcondition expression
+is raised at the point of call.}
Modify 6.1.1(30/3):
"... the checks that are performed [that]{to} verify ..."
@@ -300,8 +345,7 @@
For a dispatching call, if the assertion policy in effect at the point of the
declaration of the denoted callable entity is not the same as the assertion
policy in effect at the point of the declaration of the invoked callable entity,
-it is implementation defined whether any precondition or postcondition checks
-are made.
+it is unspecified whether any precondition or postcondition checks are made.
AARM Discussion: For a dispatching call with different policies, whether a check
is made probably will be different for different checks, depending on whether
@@ -348,8 +392,11 @@
"...instead of {at} the first freezing point..."
Modify 9.10(7): "...accept_statement[.]{;}"
+
+Modify 10.1.1(12.2/3): "For each [nested] package_declaration {occurring
+immediately within}[directly in]...
-Modify 10.1.1(12.2/3) and 10.1.1(12.3/3): "...{immediately within}[directly in]..."
+Modify 10.1.1(12.3/3): "...{occurring immediately within}[directly in]..."
Modify 10.1.2(21/3) and 10.1.2(22/3) by replacing "which" with "that".
@@ -383,8 +430,8 @@
Replace A.4.11(49/3-50/3) with:
-Each of the Convert and Encode functions returns a UTF_String (respectively
-UTF_8_String and UTF_16_String) value whose characters have position values
+Each of the Convert and Encode functions returns a UTF_String, UTF_8_String, or
+UTF_16_String value whose characters have position values
that correspond to the encoding of the Item parameter according to the
encoding scheme required by the function or specified by its Output_Scheme
parameter. For UTF_8, no overlong encoding is returned. A BOM is included
@@ -393,13 +440,13 @@
Each of the Encode functions takes a String, Wide_String, or Wide_Wide_String
Item parameter that is assumed to be an array of unencoded characters. Each of
-the Convert functions takes a UTF_String (respectively UTF_8_String and UTF_16_String)
+the Convert functions takes a UTF_String, UTF_8_String, or UTF_16_String
Item parameter that is assumed to contain characters whose position values correspond
to a valid encoding sequence according to the encoding scheme
required by the function or specified by its Input_Scheme parameter.
-Each of the Decode functions takes a UTF_String (respectively UTF_8_String
-and UTF_16_String) Item parameter which is assumed to contain characters
+Each of the Decode functions takes a UTF_String, UTF_8_String, or
+UTF_16_String Item parameter which is assumed to contain characters
whose position values correspond to a valid encoding sequence according to
the encoding scheme required by the function or specified by its Input_Scheme
parameter, and returns the corresponding String, Wide_String, or value.
@@ -458,22 +505,27 @@
"Capacity_Error is raised when the capacity of a container is exceeded."
Replace A.18.2(88.1/3), A.18.3(60.1/3), A.18.4(19.1/3), A.18.7(18.1/3),
-and A.18.10(78/3) with: [replacing "set" by the name of the container]
+and A.18.10(78/3) with [replacing "<Vector>" by the name of the container, and <V> by the
+initial of the container]:
+
+<Vector>'Write for a <Vector> object <V> writes Length(<V>) elements of the <vector> to the
+stream. It also may write additional information about the <vector>.
-"Set'Write writes exactly Length(Set) elements of the set to the stream. It may
-write additional information about the set as well. Set'Read reads exactly
-Length(Set) elements of Set from the stream and consumes any additional
-information written by Set'Write."
+<Vector>'Read reads the representation of a <vector> from the stream, and assigns to Item a
+<vector> with the same length and elements as was written by <Vector>'Write.
Modify A.18.2(147.20/3): "...setting [Target's] {the} length {of Target} to be that of Source)."
Modify A.18.2(231/3), A.18.3(145/3), A.18.26(5/3), A.18.26(9/3): "... [How many]{The number of} times..."
+Modify A.18.2(230.4/3) and A.18.3(144.4/3):
+"...If Start is No_Element, {then Constraint_Error is propogated}[the call is equivalent to Iterate (Container)]."
+
Modify A.18.2(251/2), A.18.3(156/2), A.18.4(79/2), A.18.7(100/2): "...that [contains]{previously
contained} the ..."
Modify A.18.2(254/2), A.18.3(159/2), A.18.4(82/2), A.18.7(103/2):
-"..object{ and changing the length of the target object to the length of the source object}."
+"...object{ and changing the length of the target object to the length of the source object}."
Modify A.18.3(88/3), A.18.4(43/3), A.18.7(38/3): "... Otherwise, {the operation is} equivalent..."
@@ -482,14 +534,58 @@
If Length (Container) <= Count, then Delete_First is equivalent to Clear (Container).
Otherwise, it removes the first Count nodes from Container.
+Add after A.18.6(46.1/3):
+
+ function Iterate (Container : in Map; Start : in Cursor)
+ return Map_Iterator_Interfaces.Reversible_Iterator'Class;
+
In A.18.6(58/2) and A.18.9(81/2), put "predecessor" in italics and add an index entry.
Modify A.18.6(74/2): "...Otherwise{,} Previous returns a cursor designating the
{predecessor }node {of}[that precedes] the one ..."
+Add after A.18.6(94.2/3):
+
+ function Iterate (Container : in Map; Start : in Cursor)
+ return Map_Iterator_Interfaces.Reversible_Iterator'Class;
+
+ If Start is not No_Element and does not designate an item in Container,
+ then Program_Error is propagated. If Start is No_Element, then Constraint_Error is
+ propagated. Iterate returns a reversible iterator object that will generate a
+ value for the loop parameter designating each node in Container, starting with
+ the node designated by Start and moving the cursor according to the successor relation
+ when used as a forward iterator, or moving
+ the cursor according to the predecessor relation when used as a reverse iterator.
+ Tampering with the cursors of Container is prohibited while the iterator object
+ exists (in particular, in the sequence_of_statements of the loop_statement
+ whose iterator_specification denotes this object). The iterator object
+ needs finalization.
+
+Add after A.18.9(61.1/3):
+
+ function Iterate (Container : in Set; Start : in Cursor)
+ return Set_Iterator_Interfaces.Reversible_Iterator'Class;
+
+
Modify A.18.9(93/2): "...Otherwise{,} Previous returns a cursor designating the
{predecessor }element {of}[that precedes] the one ..."
+Add after A.18.9(113.2/3):
+
+ function Iterate (Container : in Set; Start : in Cursor)
+ return Set_Iterator_Interfaces.Reversible_Iterator'Class;
+
+ If Start is not No_Element and does not designate an item in Container, then
+ Program_Error is propagated. If Start is No_Element, then Constraint_Error is
+ propagated. Iterate returns a reversible iterator object that will generate a
+ value for the loop parameter designating each element in Container, starting with
+ the element designated by Start and moving the cursor according to the successor
+ relation when used as a forward iterator, or moving the cursor according to the
+ predecessor relation when used as a reverse iterator. Tampering with the cursors
+ of Container is prohibited while the iterator object exists (in particular, in the
+ <sequence_of_statements of the loop_statement whose iterator_specification
+ denotes this object). The iterator object needs finalization.
+
Modify A.18.10(3/3):
...and has [no]{neither an} associated element value {nor any parent node}. ...
@@ -538,14 +634,14 @@
Modify A.18.30(17/3): "... otherwise{,} Success..."
-In B.2(10.1/2), delete "following".
+Move B.2(10.1/3) after B(1), add "...not provide any {optional} aspect, ...", and delete "following".
Modify B.3(2/2): "...types, constants{,} and ..."
Modify C.7.1(14):
"... Use of this attribute is allowed only inside an [entry_body or]
-accept_statement {or entry_body (after the entry_barrier)}
+accept_statement{, or entry_body after the entry_barrier,}
corresponding to the entry_declaration denoted by E."
Modify D.2.2(3.5/2): "...one or more Priority_Specific_Dispatching pragmas{,} the
@@ -563,6 +659,13 @@
understandability, but are not intended to change the meaning of the words,
except in the case of clear mistakes. The latter are listed below:
+1.1.4(14.1/3), 2.1(4/3), 2.1(13/2), 2.1(14/2), 2.2(2/2), 3.5(56/3), 3.5.2(2-3/2):
+ISO/IEC 10646:2011 defines the term "code point", and defines "code position" as meaning
+the same. However, 10646 never uses "code position" other than this single definition while
+it uses "code point" extensively. We want to be consistent with the 10646
+usage, as we mean the 10646 definition here. Moreover, "code position" (defined by 10646)
+can be possibly confused with "position number" (defined by 8652).
+
3.3(19): 5.5.2(8/3) specifies that some loop parameters are variables; this wording had
better reflect that.
@@ -602,8 +705,12 @@
A.18.2(88/2) and similar: An unfriendly reading of this text could lead one to believe that ONLY
elements can be written to the stream, and not additional information about empty elements,
ordering, hashing, keys, and so on. Thus we rewrite it.
+
+A.18.2(230.4/3) and A.18.3(144.4/3) [also in A.18.6(94.2/3) and A.18.9(113.2/3) changes]: We
+change Start = No_Element to raise Constraint_Error, because no other semantics seems right
+for most uses. Starting nowhere does not make much sense.
-A.18.2(252/2), A.18.3(159/2), A.18.4(82/2), A.18.7(103/2), A.18.10(228/3): An unfriendly reading
+A.18.2(254/2), A.18.3(159/2), A.18.4(82/2), A.18.7(103/2), A.18.10(228/3): An unfriendly reading
of this text could cause one to imagine that the Length of the target is unchanged (if long
enough). So we added some additional wording to ensure that no one thinks that.
@@ -613,6 +720,11 @@
ought to be a empty container (it is always allowed to ask to delete more nodes than are
present).
+A.18.6(46.1/3), A.18.6(94.2/3), A.18.9(49.1/3), A.18.9(99.2/3): There should be versions of the
+iterators that start at a particular position for the ordered forms. It's more dubious
+to iterate only part of a mapped form (as there is no defined ordering) and part of a subtree
+(starting a depth-first traversal in the middle doesn't make much sense).
+
A.18.6(58/2) and A.18.9(81/2): These are the defining occurrences; only ordered forms have
"predecessors".
@@ -640,6 +752,95 @@
@dinst
@xbullet<Annex Q, "Language-Defined Entities">
+!corrigendum 1.1.4(14.1/2)
+
+@drepl
+The delimiters, compound delimiters, reserved words, and @fa<numeric_literal>s
+are exclusively made of the characters whose code position is between
+16#20# and 16#7E#, inclusively. The special characters for which names
+are defined in this International Standard (see 2.1) belong to the same
+range. For example, the character E in the definition of exponent is the
+character whose name is "LATIN CAPITAL LETTER E", not "GREEK CAPITAL
+LETTER EPSILON".
+@dby
+The delimiters, compound delimiters, reserved words, and @fa<numeric_literal>s
+are exclusively made of the characters whose code point is between
+16#20# and 16#7E#, inclusively. The special characters for which names
+are defined in this International Standard (see 2.1) belong to the same
+range. For example, the character E in the definition of @fa<exponent> is the
+character whose name is "LATIN CAPITAL LETTER E", not "GREEK CAPITAL
+LETTER EPSILON".
+
+!corrigendum 2.1(4/2)
+
+@drepl
+The coded representation for characters is implementation defined
+(it need not be a representation defined within ISO/IEC 10646:2003).
+A character whose relative code position in its plane is 16#FFFE# or 16#FFFF#
+is not allowed anywhere in the text of a program.
+@dby
+The coded representation for characters is implementation defined
+(it need not be a representation defined within ISO/IEC 10646:2003).
+A character whose relative code point in its plane is 16#FFFE# or 16#FFFF#
+is not allowed anywhere in the text of a program.
+The only characters allowed outside of comments are those in categories
+@fa<other_format>, @fa<format_effector>, and @fa<graphic_character>.
+
+!corrigendum 2.1(13/2)
+
+@drepl
+@xhang<@xterm<@fa<format_effector>>
+The characters whose code positions are 16#09# (CHARACTER TABULATION), 16#0A#
+(LINE FEED), 16#0B# (LINE TABULATION), 16#0C# (FORM FEED), 16#0D#
+(CARRIAGE RETURN), 16#85# (NEXT LINE), and the characters in
+categories @fa<separator_line> and @fa<separator_paragraph>.>
+@dby
+@xhang<@xterm<@fa<format_effector>>
+The characters whose code points are 16#09# (CHARACTER TABULATION), 16#0A#
+(LINE FEED), 16#0B# (LINE TABULATION), 16#0C# (FORM FEED), 16#0D#
+(CARRIAGE RETURN), 16#85# (NEXT LINE), and the characters in
+categories @fa<separator_line> and @fa<separator_paragraph>.>
+
+!corrigendum 2.1(14/2)
+
+@drepl
+@xhang<@xterm<@fa<graphic_character>>
+Any character which is not in the categories @fa<other_control>,
+@fa<other_private_use>, @fa<other_surrogate>, @fa<other_format>,
+@fa<format_effector>, and whose code position is neither 16#FFFE# nor
+16#FFFF#.>
+@dby
+@xhang<@xterm<@fa<graphic_character>>
+Any character which is not in the categories @fa<other_control>,
+@fa<other_private_use>, @fa<other_surrogate>, @fa<other_format>,
+@fa<format_effector>, and whose code point is neither 16#FFFE# nor
+16#FFFF#.>
+
+!corrigendum 2.2(2/2)
+
+@drepl
+The text of a @fa<compilation> is divided into @i<lines>.
+In general, the representation for an end of line is implementation defined.
+However, a sequence of one or more @fa<format_effector>s other
+than the character whose code position is 16#09# (CHARACTER TABULATION)
+signifies at least one end of line.
+@dby
+The text of a @fa<compilation> is divided into @i<lines>.
+In general, the representation for an end of line is implementation defined.
+However, a sequence of one or more @fa<format_effector>s other
+than the character whose code point is 16#09# (CHARACTER TABULATION) signifies
+at least one end of line.
+
+!corrigendum 2.2(5/2)
+
+@drepl
+@xbullet<The character whose code position is 16#09# (CHARACTER TABULATION)
+is a separator except within a @fa<comment>.>
+@dby
+@xbullet<The character whose code point is 16#09# (CHARACTER TABULATION)
+is a separator except within a @fa<comment>.>
+
+
!corrigendum 3.2.4(0)
@dinsc
@@ -680,6 +881,96 @@
implementation defined (but no shorter than that of S'Wide_Wide_Image for the
same value of Arg).>
+!corrigendum 3.5(56/2)
+
+@drepl
+An implementation may extend the Wide_Wide_Value, Wide_Value, Value, Wide_Wide_Image,
+Wide_Image, and Image attributes of a floating point type to support special values
+such as infinities and NaNs.
+@dby
+An implementation may extend the Wide_Wide_Value, Wide_Value, and Value
+attributes of a character type to accept strings starting with "Hex_"
+(ignoring case) for graphics characters and those with a code
+point smaller than 16#100#, and three character strings of the form
+"'@i<nongraphic character>'".
+
+!corrigendum 3.5.2(2/2)
+
+@drepl
+The predefined type Character is a character type whose values correspond to
+the 256 code positions of Row 00 (also known as Latin-1) of the ISO/IEC 10646:2003 Basic
+Multilingual Plane (BMP). Each of the graphic characters of Row 00 of the BMP
+has a corresponding @fa<character_literal> in Character. Each of the nongraphic
+positions of Row 00 (0000-001F and 007F-009F) has a corresponding
+language-defined name, which is not usable as an enumeration literal, but which
+is usable with the attributes Image, Wide_Image,
+Wide_Wide_Image, Value, Wide_Value, and Wide_Wide_Value; these names are
+given in the definition of type Character in A.1, "The Package Standard", but
+are set in @i<italics>.
+@dby
+The predefined type Character is a character type whose values correspond to
+the 256 code points of Row 00 (also known as Latin-1) of the ISO/IEC 10646:2003 Basic
+Multilingual Plane (BMP). Each of the graphic characters of Row 00 of the BMP
+has a corresponding @fa<character_literal> in Character. Each of the nongraphic
+characters of Row 00 has a corresponding
+language-defined name, which is not usable as an enumeration literal, but which
+is usable with the attributes Image, Wide_Image,
+Wide_Wide_Image, Value, Wide_Value, and Wide_Wide_Value; these names are
+given in the definition of type Character in A.1, "The Package Standard", but
+are set in @i<italics>.
+
+!corrigendum 3.5.2(3/2)
+
+@drepl
+The predefined type Wide_Character is a character type whose values correspond
+to the 65536 code positions of the ISO/IEC 10646:2003 Basic Multilingual Plane (BMP).
+Each of the graphic characters of the BMP has a corresponding @fa<character_literal>
+in Wide_Character. The first 256 values of Wide_Character have the same
+@fa<character_literal> or language-defined name as defined for Character.
+Each of the @fa<graphic_character>s has a corresponding @fa<character_literal>.
+@dby
+The predefined type Wide_Character is a character type whose values correspond
+to the 65536 code points of the ISO/IEC 10646:2003 Basic Multilingual Plane (BMP).
+Each of the graphic characters of the BMP has a corresponding @fa<character_literal>
+in Wide_Character. The first 256 values of Wide_Character have the same
+@fa<character_literal> or language-defined name as defined for Character.
+Each of the @fa<graphic_character>s has a corresponding @fa<character_literal>.
+
+!corrigendum 3.5.2(3.1/2)
+
+@drepl
+The predefined type Wide_Wide_Character is a character type whose values
+correspond to the 2147483648 code positions of the ISO/IEC 10646:2003 character
+set. Each of the @fa<graphic_character>s has a corresponding @fa<character_literal>
+in Wide_Wide_Character. The first 65536 values of Wide_Wide_Character have the
+same @fa<character_literal> or language-defined name as defined for
+Wide_Character.
+@dby
+The predefined type Wide_Wide_Character is a character type whose values
+correspond to the 2147483648 code points of the ISO/IEC 10646:2003 character
+set. Each of the @fa<graphic_character>s has a corresponding @fa<character_literal>
+in Wide_Wide_Character. The first 65536 values of Wide_Wide_Character have the
+same @fa<character_literal> or language-defined name as defined for
+Wide_Character.
+
+!corrigendum 3.5.2(3.2/2)
+
+@drepl
+The characters whose code position is larger than 16#FF# and which are not
+graphic_characters have language-defined names which are formed by appending to the
+string "Hex_" the representation of their code position in hexadecimal as eight
+extended digits. As with other language-defined names, these names are usable only
+with the attributes (Wide_)Wide_Image and (Wide_)Wide_Value; they are not usable as
+enumeration literals.
+@dby
+The characters whose code point is larger than 16#FF# and which are not
+graphic_characters have language-defined names which are formed by appending to the
+string "Hex_" the representation of their code point in hexadecimal as eight
+extended digits. As with other language-defined names, these names are usable only
+with the attributes (Wide_)Wide_Image and (Wide_)Wide_Value; they are not usable as
+enumeration literals.
+
+
!corrigendum 3.8.1(10)
@drepl
@@ -1028,7 +1319,7 @@
@xbullet<For each nested @fa<package_declaration>, a declaration of the
limited view of that package, with the same @fa<defining_program_unit_name>.>
@dby
-@xbullet<For each nested @fa<package_declaration> immediately with the visible
+@xbullet<For each @fa<package_declaration> occurring immediately with the visible
part, a declaration of the limited view of that package, with the same
@fa<defining_program_unit_name>.>
@@ -1039,7 +1330,7 @@
incomplete view of the type; if the @fa<type_declaration> is tagged, then the
view is a tagged incomplete view.>
@dby
-@xbullet<For each @fa<type_declaration> immediately within the visible part that is
+@xbullet<For each @fa<type_declaration> occurring immediately within the visible part that is
not an @fa<incomplete_type_declaration>, an incomplete view of the type with no
@fa<discriminant_part>; if the @fa<type_declaration> is tagged, then the view
is a tagged incomplete view.>
@@ -1255,10 +1546,11 @@
Execution of the default implementation of the Input, Output, Read, or Write
attribute of type Cursor raises Program_Error.
@dinst
-Vector'Write writes exactly Length(Vector) elements of the vector to the stream.
-It may write additional information about the vector as well. Vector'Read reads
-exactly Length(Vector) elements of Vector from the stream and consumes any
-additional information written by Vector'Write.
+Vector'Write for a Vector object @i<V> writes Length(@i<V>) elements of the vector to the
+stream. It also may write additional information about the vector.
+
+Vector'Read reads the representation of a vector from the stream, and assigns to @i<Item>
+a vector with the same length and elements as was written by Vector'Write.
!corrigendum A.18.2(147/2)
@@ -1267,6 +1559,42 @@
@dinst
Nothing.
+!corrigendum A.18.2(230/2)
+
+@drepl
+@xindent<Iterates over the elements in Container as per Iterate, except that elements
+are traversed in reverse index order.>
+@dby
+@xindent<Iterates over the elements in Container as per procedure Iterate, except
+that elements are traversed in reverse index order.>
+
+@xcode<@b<function> Iterate (Container : @b<in> Vector)
+ @b<return> Vector_Iterator_Interfaces.Reversible_Iterator'Class;>
+
+@xindent<Iterate returns a reversible iterator object that will generate a
+value for the loop parameter designating each node in Container, starting with
+the first node and moving the cursor as per the Next function when
+used as a forward iterator, and starting with the last node and moving
+the cursor as per the Previous function when used as a reverse iterator.
+Tampering with the cursors of Container is prohibited while the iterator object
+exists (in particular, in the @fa<sequence_of_statements> of the @fa<loop_statement>
+whose @fa<iterator_specification> denotes this object). The iterator object
+needs finalization.>
+
+@xcode<@b<function> Iterate (Container : @b<in> Vector; Start : @b<in> Cursor)
+ @b<return> Vector_Iterator_Interfaces.Reversible_Iterator'Class;>
+
+@xindent<If Start is not No_Element and does not designate an item in Container, then
+Program_Error is propagated. If Start is No_Element, then Constraint_Error is propagated.
+Otherwise, Iterate returns a reversible iterator object that will generate
+a value for the loop parameter designating each node in Container, starting with the
+node designated by Start and moving the cursor as per the Next function
+when used as a forward iterator, or moving the cursor as per the Previous
+function when used as a reverse iterator. Tampering with the cursors of Container
+is prohibited while the iterator object exists (in particular, in the
+@fa<sequence_of_statements> of the @fa<loop_statement> whose @fa<iterator_specification>
+denotes this object). The iterator object needs finalization.>
+
!corrigendum A.18.2(231/2)
@drepl
@@ -1310,10 +1638,11 @@
Execution of the default implementation of the Input, Output, Read, or Write attribute of
type Cursor raises Program_Error.
@dinst
-List'Write writes exactly Length(List) elements of the list to the stream. It
-may write additional information about the list as well. List'Read reads exactly
-Length(List) elements of List from the stream and consumes any additional
-information written by List'Write.
+List'Write for a List object @i<L> writes Length(@i<L>) elements of the list to the
+stream. It also may write additional information about the list.
+
+List'Read reads the representation of a list from the stream, and assigns to @i<Item>
+a list with the same length and elements as was written by List'Write.
!corrigendum A.18.3(88/2)
@@ -1334,6 +1663,44 @@
@xindent<If Length (Container) <= Count, then Delete_First is equivalent to Clear (Container).
Otherwise, it removes the first Count nodes from Container.>
+!corrigendum A.18.3(144/2)
+
+@drepl
+@xindent<Iterates over the nodes in Container as per Iterate, except that elements
+are traversed in reverse order, starting with the last node and moving the cursor as per
+the Previous function.>
+@dby
+@xindent<Iterates over the nodes in Container as per procedure Iterate, except that
+elements are traversed in reverse order, starting with the last node and moving the cursor
+as per the Previous function.>
+
+@xcode<@b<function> Iterate (Container : @b<in> List)
+ @b<return> List_Iterator_Interfaces.Reversible_Iterator'Class;>
+
+@xindent<Iterate returns a reversible iterator object that will generate a
+value for the loop parameter designating each node in Container, starting with
+the first node and moving the cursor as per the Next function when
+used as a forward iterator, and starting with the last node and moving
+the cursor as per the Previous function when used as a reverse iterator.
+Tampering with the cursors of Container is prohibited while the iterator object
+exists (in particular, in the @fa<sequence_of_statements> of the @fa<loop_statement>
+whose @fa<iterator_specification> denotes this object). The iterator object
+needs finalization.>
+
+@xcode<@b<function> Iterate (Container : @b<in> List; Start : @b<in> Cursor)
+ @b<return> List_Iterator_Interfaces.Reversible_Iterator'Class;>
+
+@xindent<If Start is not No_Element and does not designate an item in Container, then Program_Error
+is propagated. If Start is No_Element, then Constraint_Error is propogated.
+Otherwise, Iterate returns a reversible iterator object that will generate
+a value for the loop parameter designating each node in Container, starting with the
+node designated by Start and moving the cursor as per the Next function
+when used as a forward iterator, or moving the cursor as per the Previous
+function when used as a reverse iterator. Tampering with the cursors of Container
+is prohibited while the iterator object exists (in particular, in the
+@fa<sequence_of_statements> of the @fa<loop_statement> whose @fa<iterator_specification>
+denotes this object). The iterator object needs finalization.>
+
!corrigendum A.18.3(145/2)
@drepl
@@ -1377,11 +1744,12 @@
Execution of the default implementation of the Input, Output, Read, or Write
attribute of type Cursor raises Program_Error.
@dinst
-Map'Write writes exactly Length(Map) elements of the map to the stream. It may
-write additional information about the map as well. Map'Read reads exactly
-Length(Map) elements of Map from the stream and consumes any additional
-information written by Map'Write.
+Map'Write for a Map object @i<M> writes Length(@i<M>) elements of the map to the
+stream. It also may write additional information about the map.
+Map'Read reads the representation of a map from the stream, and assigns to @i<Item>
+a map with the same length and elements as was written by Map'Write.
+
!corrigendum A.18.4(43/2)
@drepl
@@ -1410,6 +1778,19 @@
copying the elements from the source map object to the target map object
and changing the length of the target object to that of the source object.
+!corrigendum A.18.6(46/2)
+
+@dinsa
+@xcode< @b<procedure> Reverse_Iterate
+ (Container : @b<in> Map;
+ Process : @b<not null access procedure> (Position : @b<in> Cursor));>
+@dinss
+@xcode< @b<function> Iterate (Container : @b<in> Map)
+ @b<return> Map_Iterator_Interfaces.Reversible_Iterator'Class;>
+
+@xcode< @b<function> Iterate (Container : @b<in> Map; Start : @b<in> Cursor)
+ @b<return> Map_Iterator_Interfaces.Reversible_Iterator'Class;>
+
!corrigendum A.18.6(58/2)
@drepl
@@ -1440,6 +1821,45 @@
returns a cursor designating the predecessor node of the one designated by Position.
If Position designates the first element, then Previous returns No_Element.
+!corrigendum A.18.6(94/2)
+
+@drepl
+@xindent<Iterates over the nodes in Container as per Iterate, with the
+difference that the nodes are traversed in predecessor order, starting with
+the last node.>
+@dby
+@xindent<Iterates over the nodes in Container as per procedure Iterate,
+with the difference that the nodes are traversed in predecessor order,
+starting with the last node.>
+
+@xcode<@b<function> Iterate (Container : @b<in> Map)
+ @b<return> Map_Iterator_Interfaces.Reversible_Iterator'Class;>
+
+@xindent<Iterate returns a reversible iterator object that will generate a
+value for the loop parameter designating each node in Container, starting with
+the first node and moving the cursor according to the successor relation when
+used as a forward iterator, and starting with the last node and moving
+the cursor according to the predecessor relation when used as a reverse iterator.
+Tampering with the cursors of Container is prohibited while the iterator object
+exists (in particular, in the @fa<sequence_of_statements> of the @fa<loop_statement>
+whose @fa<iterator_specification> denotes this object). The iterator object
+needs finalization.>
+
+@xcode<@b<function> Iterate (Container : @b<in> Map; Start : @b<in> Cursor)
+ @b<return> Map_Iterator_Interfaces.Reversible_Iterator'Class;>
+
+@xindent<If Start is not No_Element and does not designate an item in Container,
+then Program_Error is propagated. If Start is No_Element, then Constraint_Error is
+propagated. Iterate returns a reversible iterator object that will generate a
+value for the loop parameter designating each node in Container, starting with
+the node designated by Start and moving the cursor according to the successor relation
+when used as a forward iterator, or moving
+the cursor according to the predecessor relation when used as a reverse iterator.
+Tampering with the cursors of Container is prohibited while the iterator object
+exists (in particular, in the @fa<sequence_of_statements> of the @fa<loop_statement>
+whose @fa<iterator_specification> denotes this object). The iterator object
+needs finalization.>
+
!corrigendum A.18.7(18/2)
!AI-0001-1
!AI-0212-1
@@ -1449,11 +1869,11 @@
Execution of the default implementation of the Input, Output, Read, or Write
attribute of type Cursor raises Program_Error.
@dinst
-Set'Write writes exactly Length(Set) elements of the set to the stream. It may
-write additional information about the set as well. Set'Read reads exactly
-Length(Set) elements of Set from the stream and consumes any additional
-information written by Set'Write.
+Set'Write for a Set object @i<S> writes Length(@i<S>) elements of the set to the
+stream. It also may write additional information about the set.
+Set'Read reads the representation of a set from the stream, and assigns to @i<Item>
+a set with the same length and elements as was written by Set'Write.
!corrigendum A.18.7(100/2)
@@ -1473,6 +1893,19 @@
copying the elements from the source set object to the target set object
and changing the length of the target object to that of the source object.
+!corrigendum A.18.9(61/2)
+
+@dinsa
+@xcode< @b<procedure> Iterate
+ (Container : @b<in> Set;
+ Process : @b<not null access procedure> (Position : @b<in> Cursor));>
+@dinss
+@xcode< @b<function> Iterate (Container : @b<in> Set)
+ @b<return> Set_Iterator_Interfaces.Reversible_Iterator'Class;>
+
+@xcode< @b<function> Iterate (Container : @b<in> Set; Start : @b<in> Cursor)
+ @b<return> Set_Iterator_Interfaces.Reversible_Iterator'Class;>
+
!corrigendum A.18.9(81/2)
@drepl
@@ -1501,6 +1934,46 @@
returns a cursor designating the predecessor element of the one designated by Position.
If Position designates the first element, then Previous returns No_Element.
+!corrigendum A.18.9(113/2)
+!AI-0212-1
+!AI-0262-1
+!AI-0265-1
+
+@drepl
+@xindent<Iterates over the elements in Container as per Iterate, with the difference
+that elements are traversed in predecessor order, starting with the last element.>
+@dby
+@xindent<Iterates over the elements in Container as per procedure Iterate, with the
+difference that the elements are traversed in predecessor order, starting with the last
+element.>
+
+@xcode<@b<function> Iterate (Container : @b<in> Set)
+ @b<return> Map_Iterator_Interfaces.Reversible_Iterator'Class;>
+
+@xindent<Iterate returns a reversible iterator object that will generate a
+value for the loop parameter designating each element in Container, starting with
+the first element and moving the cursor according to the successor relation when
+used as a forward iterator, and starting with the last element and moving
+the cursor according to the predecessor relation when used as a reverse iterator.
+Tampering with the cursors of Container is prohibited while the iterator object
+exists (in particular, in the @fa<sequence_of_statements> of the @fa<loop_statement>
+whose @fa<iterator_specification> denotes this object). The iterator object
+needs finalization.>
+
+@xcode<@b<function> Iterate (Container : @b<in> Set; Start : @b<in> Cursor)
+ @b<return> Map_Iterator_Interfaces.Reversible_Iterator'Class;>
+
+@xindent<If Start is not No_Element and does
+not designate an item in Container, then Program_Error is propagated. If Start
+is No_Element, then Constraint_Error is propagated. Iterate returns a reversible
+iterator object that will generate a value for the loop parameter designating
+each element in Container, starting with the element designated by Start and
+moving the cursor according to the successor relation when used as a forward
+iterator, or moving the cursor according to the predecessor relation when used
+as a reverse iterator. Tampering with the cursors of Container is prohibited while
+the iterator object exists (in particular, in the @fa<sequence_of_statements> of
+the @fa<loop_statement> whose @fa<iterator_specification> denotes this object).
+The iterator object needs finalization.>
!corrigendum A.18.10(0)
@@ -1566,8 +2039,36 @@
Force a conflict; the real text is found in the conflict file.
+
+!corrigendum B(1)
+
+@dinsa
+This Annex describes features for writing mixed-language programs. General interface support is
+presented first; then specific support for C, COBOL, and Fortran is defined, in terms of language
+interface packages for each of these languages.
+@dinst
+Support for interfacing to any foreign language is optional. However, an implementation
+shall not provide any optional aspect, attribute, library unit, or pragma having the same name as an
+aspect, attribute, library unit, or pragma (respectively) specified in the clauses of this Annex
+unless the provided construct is either as specified in those clauses or is more limited in
+capability than that required by those clauses. A program that attempts to use an unsupported
+capability of this Annex shall either be identified by the implementation before run time or
+shall raise an exception at run time.
+
!corrigendum B.2(10.1/2)
+@ddel
+Support for interfacing to any foreign language is optional. However, an implementation
+shall not provide any attribute, library unit, or pragma having the same name as an attribute,
+library unit, or pragma (respectively) specified in the following clauses of this Annex unless
+the provided construct is either as specified in those clauses or is more limited in capability
+than that required by those clauses. A program that attempts to use an unsupported capability
+of this Annex shall either be identified by the implementation before run time or shall raise
+an exception at run time.
+
+
+!corrigendum B.2(10.1/2)
+
@drepl
Support for interfacing to any foreign language is optional. However, an implementation
shall not provide any attribute, library unit, or pragma having the same name as an attribute,
@@ -1610,7 +2111,7 @@
@xhang<@xterm<E'Caller>
Yields a value of the type Task_Id that identifies the task whose call is now
being serviced. Use of this attribute is allowed only inside an
-@fa<accept_statement> or @fa<entry_body> (after the @fa<entry_barrier>)
+@fa<accept_statement>, or @fa<entry_body> after the @fa<entry_barrier>,
corresponding to the @fa<entry_declaration> denoted by E.>
@@ -3728,5 +4229,607 @@
Sent: Friday, October 28, 2011 9:23 AM
Fine by me.
+
+****************************************************************
+
+From: Edmond Schonberg
+Sent: Wednesday, November 9, 2011 9:09 AM
+
+The last paragraph of 5.5.2 describes the behavior of a reverse iteration as
+replacing First and Next with Last and Previous in the behavior of a forward
+iteration. It is not clear what should happen if the iterator is created with
+an explicit Start cursor. The iteration might proceed for the given start to
+the "bottom" of the container (i.e. until Has_Element becomes false). It might
+proceed from the Last value of the cursor down to the specified First in the
+iterator. Which is the intended reading?
+
+****************************************************************
+
+From: Edmond Schonberg
+Sent: Wednesday, November 9, 2011 9:43 AM
+
+Answering my own question: I expect the proper reading to be the second: from
+Last of container down to the specified First, inclusive, because elsewhere the
+"reverse" does not affect the domain of iteration. An AARM note might still be
+in order.
+
+****************************************************************
+
+From: Matthew Heaney
+Sent: Wednesday, November 9, 2011 12:23 PM
+
+There are 4 things you could want to do. Given the cursor range
+
+ F <= X <= L
+
+you would want to:
+
+(1) Forward iterate over the (inclusive) range [F, X]:
+
+procedure Op (Container : Container_Type) is begin
+ for C in Container.Iterate loop
+ E := Element (C);
+ exit when C = X;
+ end loop;
+end Op;
+
+Is this correct?
+
+
+(2) Forward iterate over the (inclusive) range [X, L]:
+
+procedure Op (Container : Container_Type) is begin
+ for C in Container.Iterate (X) loop
+ E := Element (C);
+ end loop;
+end Op;
+
+Is this correct?
+
+
+(3) Reverse iterate over the (inclusive) range [F, X]:
+
+procedure Op (Container : Container_Type) is begin
+
+ -- ???
+
+end Op;
+
+I don't know how to do (3), except the old-fashioned way. (But maybe that is
+the intended mechanism).
+
+
+(4) Reverse iterate over the (inclusive) range [X, L]:
+
+procedure Op (Container : Container_Type) is
+begin
+ for C in reverse Container.Iterate (X) loop
+ E := Element (C);
+ end loop;
+end Op;
+
+Is this correct?
+
+That interpretation seems less useful (IMHO), since it duplicates:
+
+procedure Op (Container : Container_Type) is
+begin
+ for C in reverse Container.Iterate loop
+ E := Element (C);
+ exit when C = X;
+ end loop;
+end Op;
+
+
+BTW, What is the interpretation of:
+
+ for C in reverse Container.Iterate (No_Element) loop ...;
+
+?
+
+****************************************************************
+
+From: Edmond Schonberg
+Sent: Wednesday, November 9, 2011 12:52 PM
+
+...
+>(1) Forward iterate over the (inclusive) range [F, X]:
+...
+>Is this correct?
+
+Yes.
+
+>(2) Forward iterate over the (inclusive) range [X, L]:
+...
+>Is this correct?
+
+Yes.
+
+(3) Reverse iterate over the (inclusive) range [F, X]:
+...
+>I don't know how to do (3), except the old-fashioned way. (But maybe that is
+>the intended mechanism).
+
+A.18.2 (230) would indicate that this is what you obtain with reverse:
+
+If Start is not No_Element and does not designate an item in Container, then
+Program_Error is propagated. If Start is No_Element, the call is equivalent to
+Iterate (Container). Otherwise, Iterate returns a reversible iterator object
+that will generate a value for the loop parameter designating each node in
+Container, starting with the node designated by Start and moving the cursor as
+per the Next function when used as a forward iterator, or moving the cursor as
+per the Previous function when used as a reverse iterator. Tampering with the
+cursors of Container is prohibited while the iterator object exists (in
+particular, in the sequence_of_statements of the loop_statement whose
+iterator_specificationdenotes this object). The iterator object needs
+finalization.
+
+>(4) Reverse iterate over the (inclusive) range [X, L]:
+...
+>Is this correct?
+
+That would have been my understanding, but the quoted paragraph indicates
+otherwise. I have a problem with this interpretation because it means that
+reverse changes the domain of iteration over containers, when it has no such
+effect on numeric loops.
+
+>That interpretation seems less useful (IMHO), since it duplicates:
+...
+
+See above.
+
+>BTW, What is the interpretation of:
+>
+> for C in reverse Container.Iterate (No_Element) loop ...;
+>
+>?
+
+As per the quoted paragraph, equivalent to Container.Iterate
+
+****************************************************************
+
+From: Matthew Heaney
+Sent: Wednesday, November 9, 2011 1:06 PM
+
+> As per the quoted paragraph, equivalent to Container.Iterate
+
+Just so I understand, do you mean:
+
+ for C in reverse Container.Iterate (No_Elem) loop ...;
+
+is equivalent to:
+
+ for C in reverse Container.Iterate loop ...;
+
+?
+
+****************************************************************
+
+From: Matthew Heaney
+Sent: Wednesday, November 9, 2011 2:19 PM
+
+>> (4) Reverse iterate over the (inclusive) range [X, L]:
+>>
+>> procedure Op (Container : Container_Type) is begin for C in reverse
+>> Container.Iterate (X) loop E := Element (C); end loop; end Op;
+>>
+>> Is this correct?
+>
+> That would have been my understanding, but the quoted paragraph
+> indicates otherwise. I have a problem with this interpretation because
+> it means that reverse changes the domain of iteration over containers,
+> when it has no such effect on numeric loops.
+
+A different line of reasoning is that you cannot compare iteration over a
+container to iteration over a discrete range, because in the former case you
+only specify one end of the range (but which one?), and in the latter case you
+specify both ends of the range.
+
+If the cursor value is always interpreted as the start of the iteration, then in
+the reverse iteration case:
+
+ for Cur in Cont.Iterate (X) loop ...;
+
+means reverse iteration over the range [F, X].
+
+(I'm not saying this line of reasoning is correct, just that it's
+different.)
+
+There is also the matter of how to specify an empty range.
+
+If I have a classical iteration loop, like this:
+
+procedure Op (Container : Container_Type) is
+ Start : Cursor;
+begin
+ Start := ...; -- some value, could be No_Elem
+ while Has_Element (Start) loop ...;
+end Op;
+
+then if Start = No_Element, the loop does not execute.
+
+The second form of the Iterate operation doesn't work like this, and if you say:
+
+ Start := No_Element;
+ for C in Container.Iterate (Start) loop
+
+then this is interpreted as iterating over all elements, instead of none of
+them.
+
+Is there a way to specify an empty range, for the form of Iterate that accepts a
+Start parameter?
+
+****************************************************************
+
+From: Edmond Schonberg
+Sent: Wednesday, November 9, 2011 2:52 PM
+
+> Is there a way to specify an empty range, for the form of Iterate that accepts
+> a Start parameter?
+
+
+The need for such functionality does not strike me as terribly urgent....
+
+****************************************************************
+
+From: Matthew Heaney
+Sent: Wednesday, November 9, 2011 3:15 PM
+
+Fair enough. I guess the motivation for the question was about preventing
+accidental endless loops. I can imagine a scenario in which the intent is for
+the iteration to terminate when you fall off the end of the range, as is the
+case when you have a classical loop and the cursor value is No_Element. But you
+cannot use the second form of Iterate that way. If a value of No_Element for
+the Start value been given that interpretation ("no iteration occurs if Start
+equals No_Element"), then there would have been symmetry across different styles
+of iteration.
+
+****************************************************************
+
+From: Randy Brukardt
+Sent: Wednesday, November 9, 2011 11:26 PM
+
+> 1) Forward iterate over the (inclusive) range [F, X]:
+...
+>Is this correct?
+
+Yes, there is an AARM note suggesting using exit to prematurely exit a loop.
+
+>(2) Forward iterate over the (inclusive) range [X, L]:
+...
+>Is this correct?
+
+Yes.
+
+>(3) Reverse iterate over the (inclusive) range [F, X]:
+
+>I don't know how to do (3), except the old-fashioned way. (But maybe that is
+>the intended mechanism).
+
+This is how the reverse iterator is defined, IMHO: the iteration starts at X and
+proceeds toward F.
+
+procedure Op (Container : Container_Type) is
+begin
+ for C in reverse Container.Iterate (X) loop
+ E := Element (C);
+ end loop;
+end Op;
+
+Is the correct answer.
+
+>(4) Reverse iterate over the (inclusive) range [X, L]:
+>
+>procedure Op (Container : Container_Type) is
+>begin
+> for C in reverse Container.Iterate (X) loop
+> E := Element (C);
+> end loop;
+>end Op;
+>
+>Is this correct?
+
+No. (3) is the correct answer (given the current wording).
+
+>That interpretation seems less useful (IMHO), since it duplicates:
+>
+>procedure Op (Container : Container_Type) is
+>begin
+> for C in reverse Container.Iterate loop
+> E := Element (C);
+> exit when C = X;
+> end loop;
+>end Op;
+
+Right, which is why the wording means (3).
+
+>BTW, What is the interpretation of:
+>
+> for C in reverse Container.Iterate (No_Element) loop ...;
+>
+> ?
+
+The meaning as defined by the Standard [Draft 14] is that the whole container
+iteration is performed. Not sure that's ideal, but that's what it says and there
+has to have been some reason for selecting that.
+
+****************************************************************
+
+From: Randy Brukardt
+Sent: Wednesday, November 9, 2011 11:37 PM
+
+> That would have been my understanding, but the quoted paragraph indicates
+> otherwise. I have a problem with this interpretation because
+> it means that reverse changes the domain of iteration over containers,
+> when it has no such effect on numeric loops.
+
+
+There are two good reasons for this behavior:
+(1) As Matt has shown, the behavior you are suggesting is easy to write without
+ the Start parameter, while the behavior as defined in the RM is impossible
+ to write with an iterator if your semantics is adopted.
+(2) The parameter name is "Start"; you're suggesting that the iteration end at
+ Start. That's just plain mind-bending.
+
+I think that you are making a mistake assuming that these are like numeric cases
+-- as Matt notes, you are only giving the starting position, not both ends.
+
+The only counterargument is that the indexed forms of vectors will work like a
+numeric range (because they ARE a numeric range). I'd rather fix that by
+providing an iterator for them, too.
+
+Anyway, we'll need to discuss.
+
+>> That interpretation seems less useful (IMHO), since it duplicates:
+
+>See above.
+
+"See above" doesn't seem to me to be much of an answer to much "less useful". If
+we have to trade utility for intellectual purity, I surely would select utility.
+(Both is best of course, but in this case your suggestion is much less useful,
+indeed it is pointless. I'd rather get rid of reverse possibility altogether
+than adopt your semantics.)
+
+****************************************************************
+
+From: Matthew Heaney
+Sent: Wednesday, November 9, 2011 11:42 PM
+
+> The meaning as defined by the Standard is that the whole container
+> iteration is performed. Not sure that's ideal, but that's what it says
+> and there has to have been some reason for selecting that.
+
+You can see the potential problem via a kind of inductive argument:
+
+If, to iterate over the range [X, L], you do this:
+
+for C in Container.Iterate (X) loop ...;
+
+Then, to iterate over range [Next(X), L], you do this:
+
+for C in Container.Iterate (Next (X)) loop ...;
+
+This is true for all cursor values, except when X = L. This strikes me as
+error-prone.
+
+****************************************************************
+
+From: Randy Brukardt
+Sent: Wednesday, November 9, 2011 11:53 AM
+
+I admit, I think it would be better to just raise Constraint_Error, because it
+is impossible to *Start* at No_Element. And the parameter name is "Start" (and
+as previously discussed, that seems like the best thing for it to do). I don't
+like tricky interpretations (and any interpretation of No_Element here is going
+to be tricky). But I realize this doesn't match your "inductive argument".
+
+****************************************************************
+
+From: Matthew Heaney
+Sent: Thursday, November 10, 2011 12:08 AM
+
+Well you know what I always say: "you have to have a zero". (Well, it was EWD
+who said it about Red, but never mind.) I would argue that the second iterator
+form should have a way for the loop to execute 0 times.
+
+The canonical case is iterating over an empty container: it would be nice for
+the iterator to do nothing, instead of raising CE, just like for a normal
+for-loop. Generalize from an empty container to an empty sequence, and the
+argument is the same.
+
+****************************************************************
+
+From: Matthew Heaney
+Sent: Thursday, November 10, 2011 12:19 AM
+
+I had a question about implementing the second form of Iterate (the version with
+the Start parameter, as above).
+
+The factory function Iterate doesn't know whether this is a forward or reverse
+iteration, so it doesn't know whether First or Last will be called to get the
+initial value of the sequence. So both functions must return the same value
+(the value of the Start parameter -- X in our present examples).
+
+Is this correct?
+
+I think this means that there must be two distinct concrete types: (1) one for
+the first Iterate form, and (2) another for the second Iterate form.
+
+In the case of (1), First (Iterator) returns Container.First, and Last
+(Iterator) returns Container.Last.
+
+In the case of (2), First (Iterator) and Last (Iterator) both return the value
+of the Start parameter.
+
+Does this make sense? This follows from my reading of RM12 5.5.2.
+
+****************************************************************
+
+From: Randy Brukardt
+Sent: Wednesday, December 14, 2011 11:38 PM
+
+I didn't notice this question before (and nobody answered it), sorry.
+
+Matthew Heaney writes: (Back on November 10th) ...
+
+> > This is how the reverse iterator is defined, IMHO: the iteration
+> > starts at X and proceeds toward F.
+> >
+> > procedure Op (Container : Container_Type) is begin
+> > for C in reverse Container.Iterate (X) loop
+> > E := Element (C);
+> > end loop;
+> > end Op;
+> >
+> > Is the correct answer.
+>
+>
+> I had a question about implementing the second form of Iterate (the
+> version with the Start parameter, as above).
+>
+> The factory function Iterate doesn't know whether this is a forward or
+> reverse iteration, so it doesn't know whether First or Last will be
+> called to get the initial value of the sequence. So both functions
+> must return the same value (the value of the Start parameter -- X in
+> our present examples).
+>
+> Is this correct?
+>
+> I think this means that there must be two distinct concrete
+> types: (1) one for the first Iterate form, and (2) another for the
+> second Iterate form.
+>
+> In the case of (1), First (Iterator) returns Container.First, and Last
+> (Iterator) returns Container.Last.
+>
+> In the case of (2), First (Iterator) and Last (Iterator) both return
+> the value of the Start parameter.
+>
+> Does this make sense? This follows from my reading of RM12 5.5.2.
+
+Yes, that was my expectation for these iterators: each one will need a separate
+concrete implementation (all hidden in either the private part or the body of
+the container packages). One can argue that that is a downside of the interface
+model for these things: everything has to be defined as a function because
+components aren't supported in interfaces. One could imagine a model that would
+have left determining the start point to "magic" (more likely a discriminant or
+constructor function's initialization), but that would have been a lot harder to
+describe. (And it's too late to redo the underlying iterator model now, unless
+of course there is a major problem with it. This doesn't come close.)
+
+****************************************************************
+
+From: Matthew Heaney
+Sent: Thursday, December 15, 2011 9:05 AM
+
+Ed and I were able to figure out how to do it in GNAT with just a single concrete
+iterator type. The iterator object caches either the start position (if this form
+(2) as above), or null (if this is form (1) above). The First and Last iterator
+operations inspect the cursor value cached by the iterator object, and either return
+the cached value (if it's non-null, as in (2)), or the corresponding container
+position (as in (1), by forwarding the request to the container operation).
+
+****************************************************************
+
+From: Matthew Heaney
+Sent: Thursday, November 10, 2011 10:46 AM
+
+Which containers support partial iterators?
+
+(By "partial iterator" I mean the iterator factory function that accepts a
+cursor as the Start parameter, a value designating the position from which to
+begin the iteration.)
+
+I have been searching the Ada Issues databases, and grepping the text files from
+the version of RM12 that I downloaded this morning, and haven't been able to
+answer this question to my satisfaction.
+
+My copy of RM12 seems to suggest that only vectors and lists support the form
+for partial iteration.
+
+However, I'm skeptical that this is the case. My assumption is that all
+containers should support partial iteration. (Of course not all containers
+support reverse iteration, but that is an orthogonal issue.)
+
+Can someone confirm whether all containers do in fact support partial iteration?
+
+***************************************************************
+
+From: Randy Brukardt
+Sent: Thursday, November 10, 2011 6:22 PM
+
+Only list and vectors support "partial iteration", because they have a natural
+order. Trees have a separate Iterate_Subtree, but there is no support for
+starting in the middle somewhere. (It wouldn't mean much.) Perhaps the ordered
+sets and maps should also support it, but surely not the hashed sets and maps
+(those also do not support reverse iterators, since the order is unspecified --
+it makes no sense to depend on the order in any way).
+
+****************************************************************
+
+From: Matthew Heaney
+Sent: Thursday, November 10, 2011 8:52 PM
+
+> Perhaps the ordered sets and maps should also support it, but surely
+> not the hashed sets and maps (those also do not support reverse
+> iterators, since the order is unspecified -- it makes no sense to
+> depend on the order in any way).
+
+But isn't the syntax:
+
+ for C in M.Iterate (X) loop ...;
+
+defined as equivalent to:
+
+ C := X;
+ while Has_Element (C) loop
+ ...
+ Next (C);
+ end loop;
+
+?
+
+Agreed that it doesn't make sense to depend on order in any way, but that
+argument is true even for the case of iteration using a classical loop, as
+above.
+
+Anyway, no big deal. For now I'll assume that the second form can be used for
+ordered sets and maps (but not for hashed sets or maps).
+
+****************************************************************
+
+From: John Barnes
+Sent: Saturday, November 12, 2011 8:41 AM
+
+While writing the wrat, I noticed that a static predicate cannot use the operator not
+but it can use and or xor. The rule says both operands must be predicate static but not
+has only one operand. See 3.2.4(12/3 etc)
+
+Also cannot have a static conditional exoression but canhave a ststic case expression.
+Strange becuase a conditional can be mapped onto a case.
+
+****************************************************************
+
+From: Bob Duff
+Sent: Saturday, November 12, 2011 11:30 AM
+
+> While writing the wrat,
+
+You misspelled "righting the wrat".
+
+>... I noticed that a static predicate cannot use the operator not but
+>it can use and or xor. The rule says both operands must be predicate
+>static but not has only one operand. See 3.2.4(12/3 etc)
+
+Clearly a mistake. The discussion section of the AI says "not" is allowed.
+Should be:
+
+* a call to a predefined boolean logical operator, where both operands (or the
+ single operand, in the case of "not") are predicate-static; or
+
+> Also cannot have a static conditional exoression but canhave a ststic
+> case expression. Strange becuase a conditional can be mapped onto a case.
+
+I agree that's strange. I've no idea why I left that out.
****************************************************************
Questions? Ask the ACAA Technical Agent