CVS difference for ai05s/ai05-0001-1.txt
--- ai05s/ai05-0001-1.txt 2009/07/11 03:06:22 1.10
+++ ai05s/ai05-0001-1.txt 2009/10/15 04:20:16 1.11
@@ -1,4 +1,5 @@
-!standard A.4.9(11/2) 09-07-03 AI05-0001-1/07
+!standard A.4.9(8/2) 09-10-14 AI05-0001-1/08
+!standard A.4.9(11/2)
!standard A.4.10(0)
!standard A.18(4/2)
!standard A.18.1(5/2)
@@ -8,7 +9,7 @@
!standard A.18.2(93/2)
!standard A.18.2(115/2)
!standard A.18.2(147/2)
-!standard A.18.2(148/2)
+!standard A.18.2(149/2)
!standard A.18.3(17/2)
!standard A.18.3(60/2)
!standard A.18.3(65/2)
@@ -50,26 +51,34 @@
!summary
-(See proposal.)
+Bounded forms for all of the containers are added to Ada. We also add
+generalized sorting and case-insensitive comparison and hashing operations.
!problem
The Ada 2005 containers were intended to provide the needs of most common uses
(often estimated as 80%). What about the other 20%?
-In particular, better control over storage management is needed for real-time
-systems. Some users have indicated that access to a single container by multiple
-tasks is needed.
+In particular, better control over storage management is needed for high-integrity
+and hard real-time systems.
!proposal
-Bounded forms for all of the containers are added to Ada. We also add
-generalized sorting and case-insensitive comparison and hashing operations.
+(See summary.)
!wording
A.4.9 String Hashing
+Modify A.4.9(8/2) and A.4.9(11/2):
+
+[Strings.Bounded.Hash is equivalent to the function call]
+Strings.Hash (Bounded.To_String (Key));
+
+[Editor's note: This makes the style consistent with A.18.2(186/2) and many
+other paragraphs. In any case, a function cannot be equivalent to a call, so
+the current wording is misleading.]
+
Add the following declarations after A.4.9(11/2):
The library function Strings.Hash_Case_Insensitive has the following
@@ -81,8 +90,9 @@
pragma Pure (Hash_Case_Insensitive);
Returns an implementation-defined value which is a function of the value
-of Key, folded to lower case. If A and B are strings such that A equals
-B, Hash_Case_Insensitive(A) equals Hash_Case_Insensitive(B).
+of Key, converted to lower case. If A and B are strings such that
+Strings.Equal_Case_Insensitive (A, B) (see A.4.10) is
+True, then Hash_Case_Insensitive(A) equals Hash_Case_Insensitive(B).
The library function Strings.Fixed.Hash_Case_Insensitive has the
following declaration:
@@ -103,7 +113,7 @@
(Key : Bounded.Bounded_String) return Containers.Hash_Type;
pragma Preelaborate(Hash_Case_Insensitive);
-Strings.Bounded.Hash_Case_Insensitive is equivalent to the function call
+Equivalent to
Strings.Hash_Case_Insensitive (Bounded.To_String (Key));
The library function Strings.Unbounded.Hash_Case_Insensitive has the
@@ -114,8 +124,8 @@
(Key : Unbounded_String) return Containers.Hash_Type;
pragma Preelaborate(Hash_Case_Insensitive);
-Strings.Unbounded.Hash_Case_Insensitive is equivalent to the function
-call Strings.Hash_Case_Insensitive (To_String (Key));
+Equivalent to
+Strings.Hash_Case_Insensitive (To_String (Key));
A.4.10 String Comparison (new)
@@ -129,7 +139,7 @@
(Left, Right : String) return Boolean;
pragma Pure (Equal_Case_Insensitive);
-Compares strings Left and Right, folded to lower case, for equality.
+Compares strings Left and Right, converted to lower case, for equality.
The library function Strings.Fixed.Equal_Case_Insensitive has the
following declaration:
@@ -151,8 +161,7 @@
(Left, Right : Bounded.Bounded_String) return Boolean;
pragma Preelaborate(Equal_Case_Insensitive);
-Strings.Bounded.Equal_Case_Insensitive is equivalent to the function call
-Strings.Equal_Case_Insensitive (Bounded.To_String (Key));
+Equivalent to Strings.Equal_Case_Insensitive (Bounded.To_String (Key));
The library function Strings.Unbounded.Equal_Case_Insensitive has the
@@ -163,8 +172,7 @@
(Left, Right : Unbounded_String) return Boolean;
pragma Preelaborate(Equal_Case_Insensitive);
-Strings.Unbounded.Equal_Case_Insensitive is equivalent to the function
-call Strings.Equal_Case_Insensitive (To_String (Key));
+Equivalent to Strings.Equal_Case_Insensitive (To_String (Key));
The library function Strings.Less_Case_Insensitive has the following
@@ -174,7 +182,7 @@
(Left, Right : String) return Boolean;
pragma Pure (Less_Case_Insensitive);
-Performs a lexicographic comparison of strings Left and Right, folded to
+Performs a lexicographic comparison of strings Left and Right, converted to
lower case.
@@ -183,7 +191,7 @@
with Ada.Containers, Ada.Strings.Less_Case_Insensitive;
function Ada.Strings.Fixed.Less_Case_Insensitive
- (Left, Right : Bounded.Bounded_String) return Boolean
+ (Left, Right : String) return Boolean
renames Ada.Strings.Less_Case_Insensitive;
pragma Pure(Less_Case_Insensitive);
@@ -199,8 +207,7 @@
(Left, Right : Bounded.Bounded_String) return Boolean;
pragma Preelaborate(Less_Case_Insensitive);
-Strings.Bounded.Less_Case_Insensitive is equivalent to the function call
-Strings.Less_Case_Insensitive (Bounded.To_String (Key));
+Equivalent to Strings.Less_Case_Insensitive (Bounded.To_String (Key));
The library function Strings.Unbounded.Less_Case_Insensitive has the
@@ -211,8 +218,7 @@
(Left, Right : Unbounded_String) return Boolean;
pragma Preelaborate(Less_Case_Insensitive);
-Strings.Unbounded.Less_Case_Insensitive is equivalent to the function
-call Strings.Less_Case_Insensitive (To_String (Key));
+Equivalent to Strings.Less_Case_Insensitive (To_String (Key));
A.18 Containers
@@ -222,7 +228,7 @@
When a formal [operator "<"]{function} is used to provide an ordering for a
container, it is generally required to define a strict weak ordering. [An operator]{A
function} "<" defines a strict weak ordering if it is irreflexive, asymmetric,
-transitive, and in addition, if x < y for any values x and y, then for any other value z,
+transitive, and in addition, if x < y for any values x and y, then for all other values z,
(x < z) or (z < y).
@@ -244,8 +250,8 @@
Add the following after A.18.2(88/2):
-Vector'Write writes Vector.Length elements to the stream.
-Vector'Read reads Vector.Length elements from the stream.
+Vector'Write writes the length of Vector elements to the stream.
+Vector'Read reads the length of Vector elements from the stream.
AARM Implementation Note: We require streaming of containers to work
(see 13.13.2). In particular, we do not want all of the elements that
@@ -253,7 +259,7 @@
of the container have undefined contents. This will require a custom
stream attribute implementation; the language-defined default implementation
will not work (even for a bounded form, as that would most likely
-would stream the entire capacity of the vector).
+stream the entire capacity of the vector).
Add the following after A.18.2(89/2):
@@ -263,7 +269,7 @@
Add the following after A.18.2(93/2):
- * it calls Assign with V as the Target parameter; or
+ * it calls the Assign procedure with V as the Target parameter; or
Modify A.18.2(115/2):
{If the capacity of Container is already greater than or equal to
@@ -283,10 +289,9 @@
procedure Assign (Target : in out Vector; Source : in Vector);
If Target denotes the same object as Source, the operation has no
-effect. If Source length is greater than Target capacity,
-Reserve_Capacity is called with the Source length as the capacity.
-Each element of Source is assigned to the corresponding elements of
-Target.
+effect. If the length of Source is greater than the capacity of Target,
+Reserve_Capacity is called with the length of Source as the capacity.
+Each element of Source is assigned to the corresponding element of Target.
function Copy (Source : Vector; Capacity : Count_Type := 0)
return Vector;
@@ -294,14 +299,14 @@
Returns a vector whose elements are initialized from the corresponding
elements of Source. If Capacity is 0, then the vector capacity is the
length of Source; if Capacity is equal to or greater than
-Source.Length, the vector capacity is at least the specified value.
+the length of Source, the vector capacity is at least the specified value.
Otherwise, the operation propagates Capacity_Error.
-A.18.2(148/2) is replaced by the following:
+A.18.2(149/2) is replaced by the following:
If Target denotes the same object as Source, then Move has no
-effect. Otherwise, Move first calls Target.Reserve_Capacity
-(Source.Length) and then Target.Clear; then, each element from Source
+effect. Otherwise, Move first calls Reserve_Capacity (Target, Length (Source))
+and then Clear (Target); then, each element from Source
is removed from Source and inserted into Target in the original
order. The length of Source is 0 after a successful call to Move.
@@ -316,12 +321,12 @@
Add the following after A.18.3(60/2):
-List'Write writes List.Length elements to the stream.
-List'Read reads List.Length elements from the stream.
+List'Write writes the length of List elements to the stream.
+List'Read reads the length of List elements from the stream.
Add the following after A.18.3(65/2):
- * it calls Assign with L as the Target parameter; or
+ * it calls the Assign procedure with L as the Target parameter; or
Add the following after A.18.3(86/2):
@@ -329,7 +334,7 @@
If Target denotes the same object as Source, the operation has no
effect. Otherwise, it clears Target, and each element of Source is
-assigned to the corresponding elements of Target.
+assigned to the corresponding element of Target.
function Copy (Source : List) return List;
@@ -345,12 +350,12 @@
Add the following after A.18.4(10/2):
- * it calls Assign with M as the Target parameter; or
+ * it calls the Assign procedure with M as the Target parameter; or
Add the following after A.18.4(19/2):
-Map'Write writes Map.Length elements to the stream.
-Map'Read reads Map.Length elements from the stream.
+Map'Write writes the length of Map elements to the stream.
+Map'Read reads the length of Map elements from the stream.
Add the following after A.18.4(41/2):
@@ -358,7 +363,7 @@
If Target denotes the same object as Source, the operation has no
effect. Otherwise, each key/element pair of Source is assigned to
-the corresponding key/element pairs of Target.
+the corresponding key/element pair of Target.
The description of Move in A.18.4(43/2) is replaced with:
@@ -379,16 +384,16 @@
procedure Assign (Target : in out Map; Source : in Map);
-In addition to the semantics described in A.18.4, if Source.Length is
-greater than Target.Capacity, Reserve_Capacity is called with Source.Length
-as the capacity before assigning elements.
+In addition to the semantics described in A.18.4, if the length of Source is
+greater than the capacity of Target, Reserve_Capacity is called with the
+length of Source as the capacity before assigning any elements.
function Copy (Source : Map; Capacity : Count_Type := 0) return Map;
Returns a map whose keys and elements are initialized from the keys
and elements of Source. If Capacity is 0, then the map capacity is the
length of Source; if Capacity is equal to or greater than
-Source.Length, the map capacity is at least the specified value.
+the length of Source, the map capacity is at least the specified value.
Otherwise, the operation propagates Capacity_Error.
A.18.6 Containers.Ordered_Maps
@@ -410,12 +415,12 @@
Add the following after A.18.7(10/2):
- * it calls Assign with S as the Target parameter; or
+ * it calls the Assign procedure with S as the Target parameter; or
Add the following after A.18.7(18/2):
-Set'Write writes Set.Length elements to the stream.
-Set'Read reads Set.Length elements from the stream.
+Set'Write writes the length of Set elements to the stream.
+Set'Read reads the length of Set elements from the stream.
Add after A.18.7(36/2):
@@ -443,17 +448,17 @@
procedure Assign (Target : in out Set; Source : in Set);
-In addition to the semantics described in A.18.7, if Source.Length is
-greater than Target.Capacity, Reserve_Capacity is called with Source.Length
-as the capacity before assigning elements.
+In addition to the semantics described in A.18.7, if the length of Source is
+greater than the capacity of Target, Reserve_Capacity is called with the length
+of Source as the capacity before assigning any elements.
function Copy (Source : Set; Capacity : Count_Type := 0) return Set;
Returns a set whose elements are initialized from the elements of
Source. If Capacity is 0, then the set capacity is the
length of Source; if Capacity is equal to or greater than
-Source.Length, the set capacity is at least the specified value.
-Otherwise, the operation propogates Capacity_Error.
+the length of Source, the set capacity is at least the specified value.
+Otherwise, the operation propagates Capacity_Error.
A.18.9 Containers.Ordered_Sets
@@ -505,7 +510,7 @@
Containers.Bounded_Vectors has the same contents and semantics as
Containers.Vectors except:
- * pragma Preelaborate is replaced with pragma Pure.
+ * The pragma Preelaborate is replaced with pragma Pure.
AARM implementation note: Package Containers.Bounded_Vectors
cannot depend on package Ada.Finalization (because that package
@@ -520,12 +525,12 @@
Element_Type needs finalization.
* In function Copy, if the Capacity parameter is equal to or
- greater than Source.Length, the vector capacity exactly equals
+ greater than the length of Source, the vector capacity exactly equals
the value of the Capacity parameter.
- * The description of Reserve_Capacity is replaced by:
+ * The description of Reserve_Capacity is replaced with:
- If the specified Capacity is larger than the Container.Capacity,
+ If the specified Capacity is larger than the capacity of Container,
then Reserve_Capacity propagates Capacity_Error. Otherwise, the
operation has no effect.
@@ -552,7 +557,7 @@
Containers.Bounded_Doubly_Linked_Lists has the same contents and
semantics as Containers.Doubly_Linked_Lists except:
- * pragma Preelaborate is replaced with pragma Pure.
+ * The pragma Preelaborate is replaced with pragma Pure.
AARM implementation note: Package
Containers.Bounded_Doubly_Linked_Lists cannot depend on
@@ -574,25 +579,25 @@
* In procedure Assign, if Source length is greater than Target
capacity, then Capacity_Error is propagated.
- * Function Copy is declared as follows:
+ * The function Copy is replaced with:
function Copy (Source : List; Capacity : Count_Type := 0)
return List;
If Capacity is 0, then the list capacity is the length of
- Source; if Capacity is equal to or greater than Source.Length,
- the list capacity equals the value of the Capacity parameter;
+ Source; if Capacity is equal to or greater than the length of
+ Source, the list capacity equals the value of the Capacity parameter;
otherwise, the operation propagates Capacity_Error.
* In the three-parameter procedure Splice whose Source has type List,
- if the sum of Target.Length and Source.Length is greater than
- Target.Capacity, then Splice propagates Capacity_Error.
+ if the sum of the length of Target and the length of Source is greater
+ than the capacity of Target, then Splice propagates Capacity_Error.
[Editor's note: This is referring to A.18.3(112/2), but of
course we can't say that.]
- * In the four-parameter procedure Splice, if Target.Length
- equals Target.Capacity, then Splice propagates Capacity_Error.
+ * In the four-parameter procedure Splice, if the length of Target
+ equals the capacity of Target, then Splice propagates Capacity_Error.
[Editor's note: This is referring to A.18.3(114/2).]
@@ -618,7 +623,7 @@
Containers.Bounded_Hashed_Maps has the same contents and semantics as
Containers.Hashed_Maps except:
- * pragma Preelaborate is replaced with pragma Pure.
+ * The pragma Preelaborate is replaced with pragma Pure.
AARM implementation note: Package Containers.Bounded_Hashed_Maps
cannot depend on package Ada.Finalization (because that package
@@ -634,10 +639,9 @@
* The type Map needs finalization if and only if type
Key_Type or type Element_Type needs finalization.
- * The description of Reserve_Capacity is replaced
- by:
+ * The description of Reserve_Capacity is replaced with:
- If the specified Capacity is larger than the Container.Capacity,
+ If the specified Capacity is larger than the capacity of Container,
then Reserve_Capacity propagates Capacity_Error. Otherwise, the
operation has no effect.
@@ -657,7 +661,7 @@
Returns a map with key/element pairs initialized from the values
in Source. If Capacity is 0, then the map capacity is the
length of Source; if Capacity is equal to or greater than
- Source.Length, the map capacity is the value of the Capacity
+ the length of Source, the map capacity is the value of the Capacity
parameter; otherwise, the operation propagates Capacity_Error. If
the Modulus argument is 0, then the map modulus is the value
returned by a call to Default_Modulus with the map capacity as
@@ -686,7 +690,7 @@
Containers.Bounded_Ordered_Maps has the same contents and semantics as
Containers.Ordered_Maps except:
- * pragma Preelaborate is replaced with pragma Pure.
+ * The pragma Preelaborate is replaced with pragma Pure.
AARM implementation note: Package Containers.Bounded_Ordered_Maps
cannot depend on package Ada.Finalization (because that package
@@ -715,7 +719,7 @@
Returns a map with key/element pairs initialized from the values
in Source. If Capacity is 0, then the map capacity is the
length of Source; if Capacity is equal to or greater than
- Source.Length, the map capacity is the specified value;
+ the length of Source, the map capacity is the specified value;
otherwise, the operation propagates Capacity_Error.
Implementation Advice
@@ -740,7 +744,7 @@
Containers.Bounded_Hashed_Sets has the same contents and semantics as
Containers.Hashed_Sets except:
- * pragma Preelaborate is replaced with pragma Pure.
+ * The pragma Preelaborate is replaced with pragma Pure.
AARM implementation note: Package Containers.Bounded_Hashed_Sets
cannot depend on package Ada.Finalization (because that package
@@ -756,9 +760,9 @@
* The type Set needs finalization if and only if type
Element_Type needs finalization.
- * The description of Reserve_Capacity is replaced by:
+ * The description of Reserve_Capacity is replaced with:
- If the specified Capacity is larger than the Container.Capacity,
+ If the specified Capacity is larger than the capacity of Container,
then Reserve_Capacity propagates Capacity_Error. Otherwise, the
operation has no effect.
@@ -777,8 +781,8 @@
Returns a set whose elements are initialized from the values in
Source. If Capacity is 0, then the set capacity is the length
- of Source; if Capacity is equal to or greater than
- Source.Length, the set capacity is the value of the Capacity
+ of Source; if Capacity is equal to or greater than the length
+ of Source, the set capacity is the value of the Capacity
parameter; otherwise, the operation propagates Capacity_Error. If
the Modulus argument is 0, then the set modulus is the value
returned by a call to Default_Modulus with the set capacity as
@@ -807,7 +811,7 @@
Containers.Bounded_Ordered_Sets has the same contents and semantics as
Containers.Ordered_Sets except:
- * pragma Preelaborate is replaced with pragma Pure
+ * The pragma Preelaborate is replaced with pragma Pure
AARM implementation note: package Containers.Bounded_Ordered_Sets
cannot depend on package Ada.Finalization (because that package
@@ -836,7 +840,7 @@
Returns a set whose elements are initialized from the values in
Source. If Capacity is 0, then the set capacity is the length
of Source; if Capacity is equal to or greater than
- Source.Length, the set capacity is the specified value;
+ the length of Source, the set capacity is the specified value;
otherwise, the operation propagates Capacity_Error.
Implementation Advice
@@ -870,7 +874,7 @@
Reorders the elements of an indexable structure, over the range First
.. Last, such that the elements are sorted in the ordering determined by
-the generic formal Before function. The generic formal Before compares
+the generic formal function Before. The generic formal Before compares
the elements having the given indices, and the generic formal Swap
exchanges the values of the indicated elements. Any exception raised
during evaluation of Before or Swap is propagated.
@@ -887,15 +891,53 @@
!discussion
+
+The forms added were decided at the September subcommittee meeting in New York;
+see the minutes of that meeting for details (it is found in the !appendix
+section of this AI).
-The forms added were decided at the September subcommittee meeting in New York.
See also AI05-0069-1 (Indefinite_Holder), AI05-0136-1 (Multiway_Trees), and
AI05-0159-1 (Queues).
---
+Bounded forms
+
+The bounded forms are intended to bring determinism to the storage requirements
+of the various container forms. To this end, each bounded form includes
+Implementation Advice that no dynamic allocation or pointers are used to implement
+them. Thus, the bounded forms should be usable even in high-integrity contexts
+where dynamic allocation is forbidden.
+
+An alternative considered was to allow specifying the storage pool that the
+containers used. However, that does not work as well as the simpler bounded forms:
+ * allocators still would be used, which would violate the rules of some
+ high-integrity systems;
+ * the memory use by the allocators used by each container would have to be
+ defined, potentially preventing innovative implementations of the containers;
+ * the storage pool would most likely have to be customized for each container
+ usage in order to have the effect of "no dynamic allocation".
+The usage would thus be quite complicated and quite possibly not portable. The
+bounded forms are easier to understand and are obviously portable.
+
+The Assign and Copy subprograms are needed for the bounded forms in order that
+containers with different bounds can be assigned or copied. The built-in assignment
+would raise Constraint_Error if the bounds are different. In order to keep the
+unbounded and bounded forms as similar as possible, these subprograms were added
+to all of the containers.
+
+---
+
Case insensitive functions
+We added case insensitive subprograms as the most common real-world uses of strings
+are case insensitive. That means that most of the uses of containers with strings for
+keys are also case insensitive. It makes sense to provide the operations needed for
+75% of string keys in a convinient form. The provided hashing and comparison operations
+can directly be used in instances of the Map and Set containers. While it isn't hard
+to write the needed operations, it's silly to make everyone write those operations
+repeatedly.
+
Note that there are no Wide and Wide_Wide versions of these functions. Having them
would require defining case equivalence rules for the entire Unicode character set,
something we have not done so far. Case equivalence is not a 1-to-1 mapping for
@@ -906,12 +948,22 @@
!example
+!corrigendum A.4.9(8/2)
+
+@drepl
+@xindent<Strings.Bounded.Hash is equivalent to the function call
+Strings.Hash (To_String (Key));>
+@dby
+@xindent<Equivalent to Strings.Hash (To_String (Key));>
+
!corrigendum A.4.9(11/2)
-@dinsa
+@drepl
@xindent<Strings.Unbounded.Hash is equivalent to the function call
Strings.Hash (To_String (Key));>
-@dinss
+@dby
+@xindent<Equivalent to Strings.Hash (To_String (Key));>
+
The library function Strings.Hash_Case_Insensitive has the following
declaration:
@@ -921,8 +973,9 @@
@b<pragma> Pure(Hash_Case_Insensitive);>
@xindent<Returns an implementation-defined value which is a function of the value
-of Key, folded to lower case. If A and B are strings such that A equals
-B, Hash_Case_Insensitive(A) equals Hash_Case_Insensitive(B).>
+of Key, converted to lower case. If A and B are strings such that
+Strings.Equal_Case_Insensitive (A, B) (see A.4.10) is
+True, then Hash_Case_Insensitive(A) equals Hash_Case_Insensitive(B).>
The library function Strings.Fixed.Hash_Case_Insensitive has the
following declaration:
@@ -943,7 +996,7 @@
(Key : Bounded.Bounded_String) @b<return> Containers.Hash_Type;
@b<pragma> Preelaborate(Hash_Case_Insensitive);>
-@xindent<Strings.Bounded.Hash_Case_Insensitive is equivalent to the function call
+@xindent<Equivalent to
Strings.Hash_Case_Insensitive (Bounded.To_String (Key));>
The library function Strings.Unbounded.Hash_Case_Insensitive has the
@@ -954,8 +1007,8 @@
(Key : Unbounded_String) @b<return> Containers.Hash_Type;
@b<pragma> Preelaborate(Hash_Case_Insensitive);>
-@xindent<Strings.Unbounded.Hash_Case_Insensitive is equivalent to the function
-call Strings.Hash_Case_Insensitive (To_String (Key));>
+@xindent<Equivalent to
+Strings.Hash_Case_Insensitive (To_String (Key));>
!corrigendum A.4.10(0)
@@ -971,7 +1024,7 @@
@b<return> Boolean;
@b<pragma> Pure(Equal_Case_Insensitive);>
-@xindent<Compares strings Left and Right, folded to lower case, for equality.>
+@xindent<Compares strings Left and Right, converted to lower case, for equality.>
The library function Strings.Fixed.Equal_Case_Insensitive has the
following declaration:
@@ -993,7 +1046,7 @@
(Left, Right : Bounded.Bounded_String) @b<return> Boolean;
@b<pragma> Preelaborate(Equal_Case_Insensitive);>
-@xindent<Strings.Bounded.Equal_Case_Insensitive is equivalent to the function call
+@xindent<Equivalent to
Strings.Equal_Case_Insensitive (Bounded.To_String (Key));>
The library function Strings.Unbounded.Equal_Case_Insensitive has the
@@ -1004,8 +1057,8 @@
(Left, Right : Unbounded_String) @b<return> Boolean;
@b<pragma> Preelaborate(Equal_Case_Insensitive);>
-@xindent<Strings.Unbounded.Equal_Case_Insensitive is equivalent to the function
-call Strings.Equal_Case_Insensitive (To_String (Key));>
+@xindent<Equivalent to
+Strings.Equal_Case_Insensitive (To_String (Key));>
The library function Strings.Less_Case_Insensitive has the following
declaration:
@@ -1014,7 +1067,7 @@
@b<return> Boolean;
@b<pragma> Pure(Less_Case_Insensitive);>
-@xindent<Performs a lexicographic comparison of strings Left and Right, folded to
+@xindent<Performs a lexicographic comparison of strings Left and Right, converted to
lower case.>
The library function Strings.Fixed.Less_Case_Insensitive has the
@@ -1037,8 +1090,7 @@
(Left, Right : Bounded.Bounded_String) @b<return> Boolean;
@b<pragma> Preelaborate(Less_Case_Insensitive);>
-@xindent<Strings.Bounded.Less_Case_Insensitive is equivalent to the function call
-Strings.Less_Case_Insensitive (Bounded.To_String (Key));>
+@xindent<Equivalent to Strings.Less_Case_Insensitive (Bounded.To_String (Key));>
The library function Strings.Unbounded.Less_Case_Insensitive has the
following declaration:
@@ -1048,8 +1100,7 @@
(Left, Right : Unbounded_String) @b<return> Boolean;
@b<pragma> Preelaborate(Less_Case_Insensitive);>
-@xindent<Strings.Unbounded.Less_Case_Insensitive is equivalent to the function
-call Strings.Less_Case_Insensitive (To_String (Key));>
+@xindent<Equivalent to Strings.Less_Case_Insensitive (To_String (Key));>
!corrigendum A.18(4/2)
@@ -1093,8 +1144,8 @@
Execution of the default implementation of the Input, Output, Read, or Write attribute
of type Cursor raises Program_Error.
@dinst
-Vector'Write writes Vector.Length elements to the stream.
-Vector'Read reads Vector.Length elements from the stream.
+Vector'Write writes the length of Vector elements to the stream.
+Vector'Read reads the length of Vector elements from the stream.
!corrigendum A.18.2(89/2)
@@ -1112,7 +1163,7 @@
@dinsa
@xbullet<it finalizes @i<V>; or>
@dinst
-@xbullet<it calls Assign with @i<V> as the Target parameter; or>
+@xbullet<it calls the Assign procedure with @i<V> as the Target parameter; or>
!corrigendum A.18.2(115/2)
@@ -1142,9 +1193,9 @@
@xcode<@b<procedure> Assign (Target : @b<in out> Vector; Source : @b<in> Vector);>
@xindent<If Target denotes the same object as Source, the operation has no
-effect. If Source length is greater than Target capacity,
-Reserve_Capacity is called with the Source length as the capacity.
-Each element of Source is assigned to the corresponding elements of Target.>
+effect. If the length of Source is greater than the capacity of Target,
+Reserve_Capacity is called with the length of Source as the capacity.
+Each element of Source is assigned to the corresponding element of Target.>
@xcode<@b<function> Copy (Source : Vector; Capacity : Count_Type := 0)
@b<return> Vector;>
@@ -1152,10 +1203,10 @@
@xindent<Returns a vector whose elements are initialized from the corresponding
elements of Source. If Capacity is 0, then the vector capacity is the
length of Source; if Capacity is equal to or greater than
-Source.Length, the vector capacity is at least the specified value.
+the length of Source, the vector capacity is at least the specified value.
Otherwise, the operation propagates Capacity_Error.>
-!corrigendum A.18.2(148/2)
+!corrigendum A.18.2(149/2)
@drepl
If Target denotes the same object as Source, then Move has no effect. Otherwise,
@@ -1164,8 +1215,8 @@
is 0 after a successful call to Move.
@dby
If Target denotes the same object as Source, then Move has no
-effect. Otherwise, Move first calls Target.Reserve_Capacity
-(Source.Length) and then Target.Clear; then, each element from Source
+effect. Otherwise, Move first calls Reserve_Capacity (Target, Length (Source))
+and then Clear (Target); then, each element from Source
is removed from Source and inserted into Target in the original
order. The length of Source is 0 after a successful call to Move.
@@ -1188,15 +1239,15 @@
Execution of the default implementation of the Input, Output, Read, or Write attribute of
type Cursor raises Program_Error.
@dinst
-List'Write writes List.Length elements to the stream. List'Read reads List.Length elements
-from the stream.
+List'Write writes the length of List elements to the stream.
+List'Read reads the length of List elements from the stream.
!corrigendum A.18.3(65/2)
@dinsa
@xbullet<it finalizes @i<L>; or>
@dinst
-@xbullet<it calls Assign with @i<L> as the Target parameter; or>
+@xbullet<it calls the Assign procedure with @i<L> as the Target parameter; or>
!corrigendum A.18.3(86/2)
@@ -1208,7 +1259,7 @@
@xindent<If Target denotes the same object as Source, the operation has no
effect. Otherwise, it clears Target, and each element of Source is
-assigned to the corresponding elements of Target.>
+assigned to the corresponding element of Target.>
@xcode<@b<function> Copy (Source : List) @b<return> List;>
@@ -1230,7 +1281,7 @@
@dinsa
@xbullet<it finalizes @i<M>; or>
@dinst
-@xbullet<it calls Assign with @i<M> as the Target parameter; or>
+@xbullet<it calls the Assign procedure with @i<M> as the Target parameter; or>
!corrigendum A.18.4(19/2)
@@ -1238,8 +1289,8 @@
Execution of the default implementation of the Input, Output, Read, or Write
attribute of type Cursor raises Program_Error.
@dinst
-Map'Write writes Map.Length elements to the stream.
-Map'Read reads Map.Length elements from the stream.
+Map'Write writes the length of Map elements to the stream.
+Map'Read reads the length of Map elements from the stream.
!corrigendum A.18.4(41/2)
@@ -1251,7 +1302,7 @@
@xindent<If Target denotes the same object as Source, the operation has no
effect. Otherwise, each key/element pair of Source is assigned to
-the corresponding key/element pairs of Target.>
+the corresponding key/element pair of Target.>
!corrigendum A.18.4(43/2)
@@ -1269,7 +1320,7 @@
@xcode< @b<procedure> Update_Element
(Container : @b<in out> Map;
Position : @b<in> Cursor;
- Process : @b<not null access> procedure
+ Process : @b<not null access procedure>
(Key : @b<in> Key_Type;
Element : @b<in out> Element_Type));>
@dinss
@@ -1285,16 +1336,16 @@
@dinst
@xcode<@b<procedure> Assign (Target : @b<in out> Map; Source : @b<in> Map);>
-@xindent<In addition to the semantics described in A.18.4, if Source.Length is
-greater than Target.Capacity, Reserve_Capacity is called with Source.Length
-as the capacity before assigning elements.>
+@xindent<In addition to the semantics described in A.18.4, if the length of Source is
+greater than the capacity of Target, Reserve_Capacity is called with the length of Source
+as the capacity before assigning any elements.>
@xcode<@b<function> Copy (Source : Map; Capacity : Count_Type := 0) @b<return> Map;>
@xindent<Returns a map whose keys and elements are initialized from the keys
and elements of Source. If Capacity is 0, then the map capacity is the
length of Source; if Capacity is equal to or greater than
-Source.Length, the map capacity is at least the specified value.
+the length of Source, the map capacity is at least the specified value.
Otherwise, the operation propagates Capacity_Error.>
!corrigendum A.18.6(16/2)
@@ -1303,7 +1354,7 @@
@xcode< @b<procedure> Update_Element
(Container : @b<in out> Map;
Position : @b<in> Cursor;
- Process : @b<not null access> procedure
+ Process : @b<not null access procedure>
(Key : @b<in> Key_Type;
Element : @b<in out> Element_Type));>
@dinss
@@ -1332,7 +1383,7 @@
@dinsa
@xbullet<it finalizes @i<S>; or>
@dinst
-@xbullet<it calls Assign with @i<S> as the Target parameter; or>
+@xbullet<it calls the Assign procedure with @i<S> as the Target parameter; or>
!corrigendum A.18.7(18/2)
@@ -1340,8 +1391,8 @@
Execution of the default implementation of the Input, Output, Read, or Write
attribute of type Cursor raises Program_Error.
@dinst
-Set'Write writes Set.Length elements to the stream.
-Set'Read reads Set.Length elements from the stream.
+Set'Write writes the length of Set elements to the stream.
+Set'Read reads the length of Set elements from the stream.
!corrigendum A.18.7(36/2)
@@ -1349,7 +1400,8 @@
@xindent<If Position equals No_Element, then Constraint_Error is propagated.
Otherwise, Query_Element calls Process.@b<all> with the element designated by
Position as the argument. Program_Error is propagated if Process.@b<all>
-tampers with the elements of Container. Any exception raised by Process.all is propagated.>
+tampers with the elements of Container. Any exception raised by
+Process.@b<all> is propagated.>
@dinss
@xcode<@b<procedure> Assign (Target : @b<in out> Set; Source : @b<in> Set);>
@@ -1372,7 +1424,7 @@
@dinsa
@xcode< @b<procedure> Query_Element
(Position : @b<in> Cursor;
- Process : @b<not null access> procedure (Element : @b<in> Element_Type));>
+ Process : @b<not null access procedure> (Element : @b<in> Element_Type));>
@dinss
@xcode< @b<procedure> Assign (Target : @b<in out> Set; Source : @b<in> Set);>
@@ -1386,16 +1438,16 @@
@dinst
@xcode<@b<procedure> Assign (Target : @b<in out> Set; Source : @b<in> Set);>
-@xindent<In addition to the semantics described in A.18.7, if Source.Length is
-greater than Target.Capacity, Reserve_Capacity is called with Source.Length
-as the capacity before assigning elements.>
+@xindent<In addition to the semantics described in A.18.7, if the length of Source is
+greater than the capacity of Target, Reserve_Capacity is called with the length of Source
+as the capacity before assigning any elements.>
@xcode<@b<function> Copy (Source : Set; Capacity : Count_Type := 0) @b<return> Set;>
@xindent<Returns a set whose elements are initialized from the elements of
Source. If Capacity is 0, then the set capacity is the
length of Source; if Capacity is equal to or greater than
-Source.Length, the set capacity is at least the specified value.
+the length of Source, the set capacity is at least the specified value.
Otherwise, the operation propagates Capacity_Error.>
!corrigendum A.18.9(16/2)
@@ -1403,7 +1455,7 @@
@dinsa
@xcode< @b<procedure> Query_Element
(Position : @b<in> Cursor;
- Process : @b<not null access> procedure (Element : @b<in> Element_Type));>
+ Process : @b<not null access procedure> (Element : @b<in> Element_Type));>
@dinss
@xcode< @b<procedure> Assign (Target : @b<in out> Set; Source : @b<in> Set);>
@@ -1446,7 +1498,7 @@
Containers.Bounded_Vectors has the same contents and semantics as
Containers.Vectors except:
-@xbullet<@fa<Pragma> Preelaborate is replaced with @fa<pragma> Pure.>
+@xbullet<The @fa<pragma> Preelaborate is replaced with @fa<pragma> Pure.>
@xbullet<The type Vector is declared with a discriminant that specifies
the capacity:>
@@ -1457,12 +1509,12 @@
Element_Type needs finalization.>
@xbullet<In function Copy, if the Capacity parameter is equal to or
-greater than Source.Length, the vector capacity exactly equals
+greater than the length of Source, the vector capacity exactly equals
the value of the Capacity parameter.>
-@xbullet<The description of Reserve_Capacity is replaced by:>
+@xbullet<The description of Reserve_Capacity is replaced with:>
-@xindent<If the specified Capacity is larger than the Container.Capacity,
+@xindent<If the specified Capacity is larger than the capcaity of Container,
then Reserve_Capacity propagates Capacity_Error. Otherwise, the operation has no effect.>
@s8<@i<Implementation Advice>>
@@ -1489,7 +1541,7 @@
Containers.Bounded_Doubly_Linked_Lists has the same contents and
semantics as Containers.Doubly_Linked_Lists except:
-@xbullet<@fa<Pragma> Preelaborate is replaced with @fa<pragma> Pure.>
+@xbullet<The @fa<pragma> Preelaborate is replaced with @fa<pragma> Pure.>
@xbullet<The type List is declared with a discriminant that specifies
the capacity (maximum number of elements) as follows:>
@@ -1506,22 +1558,22 @@
@xbullet<In procedure Assign, if Source length is greater than Target
capacity, then Capacity_Error is propagated.>
-@xbullet<Function Copy is declared as follows:>
+@xbullet<The function Copy is declared as follows:>
@xcode< @b<function> Copy (Source : List; Capacity : Count_Type := 0)
@b<return> List;>
@xindent<If Capacity is 0, then the list capacity is the length of
-Source; if Capacity is equal to or greater than Source.Length,
+Source; if Capacity is equal to or greater than the length of Source,
the list capacity equals the value of the Capacity parameter;
otherwise, the operation propagates Capacity_Error.>
@xbullet<In the three-parameter procedure Splice whose Source has type List,
-if the sum of Target.Length and Source.Length is greater than
-Target.Capacity, then Splice propagates Capacity_Error.>
+if the sum of the length of Target and the length of Source is greater than
+the capacity of Target, then Splice propagates Capacity_Error.>
-@xbullet<In the four-parameter procedure Splice, if Target.Length
-equals Target.Capacity, then Splice propagates Capacity_Error.>
+@xbullet<In the four-parameter procedure Splice, if the length of Target
+equals the capacity of Target, then Splice propagates Capacity_Error.>
@s8<@i<Implementation Advice>>
@@ -1547,7 +1599,7 @@
Containers.Bounded_Hashed_Maps has the same contents and semantics as
Containers.Hashed_Maps except:
-@xbullet<@fa<Pragma> Preelaborate is replaced with @fa<pragma> Pure.>
+@xbullet<The @fa<pragma> Preelaborate is replaced with @fa<pragma> Pure.>
@xbullet<The type Map is declared with discriminants that specify both
the capacity (number of elements) and modulus (number of
@@ -1559,9 +1611,9 @@
@xbullet<The type Map needs finalization if and only if type
Key_Type or type Element_Type needs finalization.>
-@xbullet<The description of Reserve_Capacity is replaced by:>
+@xbullet<The description of Reserve_Capacity is replaced with:>
-@xindent<If the specified Capacity is larger than the Container.Capacity,
+@xindent<If the specified Capacity is larger than the capacity of Container,
then Reserve_Capacity propagates Capacity_Error. Otherwise, the operation has no effect.>
@xbullet<An additional operation is added immediately following Reserve_Capacity:>
@@ -1581,7 +1633,7 @@
@xindent<Returns a map with key/element pairs initialized from the values
in Source. If Capacity is 0, then the map capacity is the
length of Source; if Capacity is equal to or greater than
-Source.Length, the map capacity is the value of the Capacity
+the legnth of Source, the map capacity is the value of the Capacity
parameter; otherwise, the operation propagates Capacity_Error. If
the Modulus argument is 0, then the map modulus is the value
returned by a call to Default_Modulus with the map capacity as
@@ -1612,7 +1664,7 @@
Containers.Bounded_Ordered_Maps has the same contents and semantics as
Containers.Ordered_Maps except:
-@xbullet<@fa<Pragma> Preelaborate is replaced with @fa<pragma> Pure.>
+@xbullet<The @fa<pragma> Preelaborate is replaced with @fa<pragma> Pure.>
@xbullet<The type Map is declared with a discriminant that specifies
the capacity (maximum number of elements) as follows:>
@@ -1637,7 +1689,7 @@
@xindent<Returns a map with key/element pairs initialized from the values
in Source. If Capacity is 0, then the map capacity is the
length of Source; if Capacity is equal to or greater than
-Source.Length, the map capacity is the specified value;
+the length of Source, the map capacity is the specified value;
otherwise, the operation propagates Capacity_Error.>
@s8<@i<Implementation Advice>>
@@ -1664,7 +1716,7 @@
Containers.Bounded_Hashed_Sets has the same contents and semantics as
Containers.Hashed_Sets except:
-@xbullet<@fa<Pragma> Preelaborate is replaced with @fa<pragma> Pure.>
+@xbullet<The @fa<pragma> Preelaborate is replaced with @fa<pragma> Pure.>
@xbullet<The type Set is declared with discriminants that specify both
the capacity (number of elements) and modulus (number of
@@ -1676,9 +1728,9 @@
@xbullet<The type Set needs finalization if and only if type
Key_Type or type Element_Type needs finalization.>
-@xbullet<The description of Reserve_Capacity is replaced by:>
+@xbullet<The description of Reserve_Capacity is replaced with:>
-@xindent<If the specified Capacity is larger than the Container.Capacity,
+@xindent<If the specified Capacity is larger than the capacity of Container,
then Reserve_Capacity propagates Capacity_Error. Otherwise, the operation has no effect.>
@xbullet<An additional operation is added immediately following Reserve_Capacity:>
@@ -1693,12 +1745,12 @@
@xcode< @b<function> Copy (Source : Set;
Capacity : Count_Type := 0;
- Modulus : Hash_Type := 0) @b<return> Map;>
+ Modulus : Hash_Type := 0) @b<return> Set;>
@xindent<Returns a set whose elements are initialized from the values in
Source. If Capacity is 0, then the set capacity is the length
of Source; if Capacity is equal to or greater than
-Source.Length, the set capacity is the value of the Capacity
+the length of Source, the set capacity is the value of the Capacity
parameter; otherwise, the operation propagates Capacity_Error. If
the Modulus argument is 0, then the set modulus is the value
returned by a call to Default_Modulus with the set capacity as
@@ -1729,7 +1781,7 @@
Containers.Bounded_Ordered_Sets has the same contents and semantics as
Containers.Ordered_Sets except:
-@xbullet<@fa<Pragma> Preelaborate is replaced with @fa<pragma> Pure.>
+@xbullet<The @fa<pragma> Preelaborate is replaced with @fa<pragma> Pure.>
@xbullet<The type Set is declared with a discriminant that specifies
the capacity (maximum number of elements) as follows:>
@@ -1748,13 +1800,13 @@
@xbullet<The function Copy is replaced with:>
-@xcode< @b<function> Copy (Source : Map;
- Capacity : Count_Type := 0) @b<return> Map;>
+@xcode< @b<function> Copy (Source : Set;
+ Capacity : Count_Type := 0) @b<return> Set;>
@xindent<Returns a set whose elements are initialized from the values in
Source. If Capacity is 0, then the set capacity is the length
of Source; if Capacity is equal to or greater than
-Source.Length, the set capacity is the specified value;
+the length of Source, the set capacity is the specified value;
otherwise, the operation propagates Capacity_Error.>
@s8<@i<Implementation Advice>>
@@ -1790,7 +1842,7 @@
@dinss
The generic library procedure Containers.Generic_Sort has the following declaration:
-@xcode<generic
+@xcode<@<generic>
@b<type> Index_Type is (<@>);
@b<with function> Before (Left, Right : Index_Type) @b<return> Boolean;
@b<with procedure> Swap (Left, Right : Index_Type);
@@ -1799,7 +1851,7 @@
@xindent<Reorders the elements of an indexable structure, over the range First
.. Last, such that the elements are sorted in the ordering determined by
-the generic formal Before function. The generic formal Before compares
+the generic formal function Before. The generic formal Before compares
the elements having the given indices, and the generic formal Swap
exchanges the values of the indicated elements. Any exception raised
during evaluation of Before or Swap is propagated.>
Questions? Ask the ACAA Technical Agent