CVS difference for ais/ai-00301.txt

Differences between 1.2 and version 1.3
Log of other versions for file ais/ai-00301.txt

--- ais/ai-00301.txt	2002/07/23 01:05:25	1.2
+++ ais/ai-00301.txt	2002/08/24 03:54:24	1.3
@@ -1,4 +1,4 @@
-!standard A.4.5                                     02-06-13  AI95-00301/01
+!standard A.4.5                                     02-08-23  AI95-00301/02
 !class amendment 02-06-12
 !status work item 02-06-12
 !status received 02-06-12
@@ -8,56 +8,110 @@
 
 !summary
 
-Some additional operations on unbounded strings are proposed to be added to
-Ada.Strings.Unbounded, an I/O operations on unbounded strings are proposed to
-be provided in a new child package of Ada.Strings.Unbounded.
+Additional Index functions are added to Ada.Strings.Fixed,
+Ada.Strings.Bounded, and Ada.Strings.Unbouned. Some additional operations are
+added to Ada.Strings.Unbounded and Ada.Strings.Bounded. I/O operations on
+unbounded strings are provided in a new child package of Ada.Text_IO.
 
 !problem
 
-The interface defined for Ada.Strings.Unbounded offers many operations only
-with one parameter of type Unbounded_String and a second parameter of type
-String. Corresponding operations with both parameters of type Unbounded_String
-are missing, which requires that these have to be emulated by first converting
-the second parameter to a temporary string. This unnecessary time and storage
-overhead can be eliminated by adding the missing operations to
-Ada.Strings.Unbounded.
-
-A variation of this theme occurs if one wants to work with slices of
-Unbounded_Strings, for which these operations typically do not exist either,
-again forcing a detour through an intermediary conversion to String by calling
-To_String or Slice.
-
-Furthermore, search operations (Index) always search the whole unbounded
-string, which makes it very cumbersome to repeatedly search for a pattern in a
-string. A variant with a starting index as a parameter would be very useful.
-
-Also, while there is a function To_Unbounded_String, there is no procedural
-variant for this operation. However, such a procedure would be very useful, for
-it might be more efficient than the function.
-
-And finally, I/O operations with Unbounded_Strings as parameters are missing.
-These, too, would be useful to avoid these extra copies as Strings. Such I/O
-operations could be provided in a child package of Ada.Strings.Unbounded.
+The interface defined for Ada.Strings.Unbounded contains several instances
+where the Unbounded_String abstraction is incomplete. For instance, the Insert,
+Overwrite, and Replace_Slice routines do not include a version in which
+the new portion is an Unbounded_String. Thus, it is necessary to leave the
+Unbounded_String abstraction (by converting to String) in order to use these
+operations. This extra conversion also carries an unnecessary time and storage
+overhead.
+
+A similar problem occurs when a slice of an Unbounded_String is needed.
+The Slice function returns a String, which is outside of the Unbounded_String
+abstraction.
+
+Another problem is that Unbounded_Strings typically are implemented as a
+controlled type. That means that an assignment of an Unbounded_String has
+substantial overhead in the form of calls to Finalize and Adjust, and
+probably includes allocation of memory. Unbounded_Strings are often
+given values with the function To_Unbounded_String. However, when this
+function is used in an assignment statement, memory may be allocated twice
+(once by the function, and once by Adjust), which is substantial extra
+overhead. A procedure version of To_Unbounded_String would avoid this
+problem.
+
+A commonly encountered problem is the need to find all of the occurrences
+of a pattern in a string. The Index function always searches the entire
+string. This is not a major problem for a String, as searching the appropriate
+slice is easy. However, for an Unbounded_String, the only practical solution
+is to convert the Unbounded_String to a String, again breaking the abstraction.
+A variant with a starting index as a parameter would be very useful.
+
+And finally, I/O operations with Unbounded_Strings as parameters are not
+provided. These are commonly needed, and (in the case of Get_Line) are not
+trivial to write. An child package similar to the ones provided for Complex
+types would be valuable.
 
 !proposal
+
+Additional Index functions are added to Ada.Strings.Fixed:
 
-It is proposed to add the following operations to package
-Ada.Strings.Unbounded:
+    function Index (Source : in String;
+                    Pattern : in String;
+                    From : in Positive;
+                    Going : in Direction := Forward;
+                    Mapping : in Maps.Character_Mapping := Maps.Identity)
+                        return Natural;
+    -- If Going = Forward, this is equivalent to
+    --    Index (Source(From..Source'Last), Pattern, Going, Mapping)
+    -- Otherwise, this is equivalent to
+    --    Index (Source(Source'First..From), Pattern, Going, Mapping)
+
+    function Index (Source : in String;
+                    Pattern : in String;
+                    From : in Positive;
+                    Going : in Direction := Forward;
+                    Mapping : in Maps.Character_Mapping_Function) return Natural;
+    -- If Going = Forward, this is equivalent to
+    --    Index (Source(From..Source'Last), Pattern, Going, Mapping)
+    -- Otherwise, this is equivalent to
+    --    Index (Source(Source'First..From), Pattern, Going, Mapping)
+
+    function Index (Source : in String;
+                    Set : in Maps.Character_Set;
+                    From : in Positive;
+                    Test : in Membership := Inside;
+                    Going : in Direction := Forward) return Natural;
+    -- If Going = Forward, this is equivalent to
+    --    Index (Source(From..Source'Last), Set, Test, Going)
+    -- Otherwise, this is equivalent to
+    --    Index (Source(Source'First..From), Set, Test, Going)
+
+    function Index_Non_Blank (Source : in String;
+                              From : in Positive;
+                              Going : in Direction := Forward) return Natural;
+    -- If Going = Forward, this is equivalent to
+    --    Index_Non_Blank (Source(From..Source'Last), Going)
+    -- Otherwise, this is equivalent to
+    --    Index_Non_Blank (Source(Source'First..From), Going)
 
-package Ada.Strings.Unbounded is
 
-   ...
+Similar functions are added to Ada.Strings.Bounded and Ada.Strings.Unbounded.
 
-   ---------------------------------------------------------------------
-   --  Additional string-to-unbounded-string conversion:
+
+The following operation is added to package Ada.Strings.Bounded:
+
+   procedure To_Bounded_String
+     (Target : in out Bounded_String;
+      Str    : in     String);
+   --  Identical in effect to Target := To_Bounded_String (Str);
 
-   procedure Set
+The following operation is added to package Ada.Strings.Unbounded:
+
+   procedure To_Unbounded_String
      (Target : in out Unbounded_String;
       Str    : in     String);
    --  Identical in effect to Target := To_Unbounded_String (Str);
+
 
-   ---------------------------------------------------------------------
-   --  Additional operations for obtaining slices:
+The following operations are added to package Ada.Strings.Unbounded:
 
    function Slice
      (Source : in Unbounded_String;
@@ -73,122 +127,22 @@
       High   : in     Natural);
    --  Identical to Target := To_Unbounded_String (Slice (Source, Low, High));
 
-   ---------------------------------------------------------------------
-   --  Index operations with a From parameter giving the place where the
-   --  search should start.
-
-   function Index
-     (Source  : in Unbounded_String;
-      Pattern : in String;
-      From    : in Positive;
-      Going   : in Direction              := Forward;
-      Mapping : in Maps.Character_Mapping := Maps.Identity)
-     return Natural;
-   --  If Going = Forward, identical in effect to
-   --    Index (Slice (Source, From, Length (Source)),
-   --           Pattern, Going, Mapping);
-   --  otherwise Going is Backward and the operation is identical to
-   --    Index (Slice (Source, 1, From), Pattern, Going, Mapping);
-
-   function Index
-     (Source  : in Unbounded_String;
-      Pattern : in Unbounded_String;
-      From    : in Positive               := 1;
-      Going   : in Direction              := Forward;
-      Mapping : in Maps.Character_Mapping := Maps.Identity)
-     return Natural;
-   --  Identical in effect to
-   --    Index (Source, To_String (Pattern), From, Going, Mapping);
-
-   function Index
-     (Source  : in Unbounded_String;
-      Pattern : in Unbounded_String;
-      Low     : in Positive;
-      High    : in Natural;
-      From    : in Positive               := 1;
-      Going   : in Direction              := Forward;
-      Mapping : in Maps.Character_Mapping := Maps.Identity)
-     return Natural;
-   --  "Sliced" Index: identical in effect to
-   --    Index (Source, Slice (Pattern, Low, High), From, Going, Mapping);
-
-   function Index
-     (Source  : in Unbounded_String;
-      Pattern : in String;
-      From    : in Positive;
-      Going   : in Direction := Forward;
-      Mapping : in Maps.Character_Mapping_Function)
-     return Natural;
-   --  If Going = Forward, identical in effect to
-   --    Index (Slice (Source, From, Length (Source)),
-   --           Pattern, Going, Mapping);
-   --  otherwise Going is Backward and the operation is identical to
-   --    Index (Slice (Source, 1, From), Pattern, Going, Mapping);
-
-   function Index
-     (Source  : in Unbounded_String;
-      Pattern : in Unbounded_String;
-      From    : in Positive  := 1;
-      Going   : in Direction := Forward;
-      Mapping : in Maps.Character_Mapping_Function)
-     return Natural;
-   --  Identical in effect to
-   --    Index (Source, To_String (Pattern), From, Going, Mapping);
-
-   function Index
-     (Source  : in Unbounded_String;
-      Pattern : in Unbounded_String;
-      Low     : in Positive;
-      High    : in Natural;
-      From    : in Positive  := 1;
-      Going   : in Direction := Forward;
-      Mapping : in Maps.Character_Mapping_Function)
-     return Natural;
-   --  "Sliced" Index: identical in effect to
-   --    Index (Source, Slice (Pattern, Low, High), From, Going, Mapping);
-
-   -------------------------------------------------------------------
-   --  Slice operations. These are useful because they avoid the need of
-   --  an intermediary explicit representation of the slice, which would
-   --  require an intermediary extra copy of the string data.
-
-   function  Append_Slice
-     (Source : in Unbounded_String;
-      From   : in Unbounded_String;
-      Low    : in Positive;
-      High   : in Natural)
-     return Unbounded_String;
-   --  Identical in effect to
-   --    Append (Source, Slice (From, Low, High));
-
-   procedure Append_Slice
-     (Source : in out Unbounded_String;
-      From   : in     Unbounded_String;
-      Low    : in     Positive;
-      High   : in     Natural);
-   --  Identical in effect to
-   --    Append (Source, Slice (From, Low, High));
-
    function  Replace_Slice
      (Source : in Unbounded_String;
       Low    : in Positive;
       High   : in Natural;
-      By     : in Unbounded_String;
-      From   : in Positive;
-      To     : in Natural)
+      By     : in Unbounded_String)
      return Unbounded_String;
    --  Identical in effect to
-   --    Replace_Slice (Source, Low, High, Slice (By, From, To));
+   --    Replace_Slice (Source, Low, High, To_String (By));
 
    procedure Replace_Slice
      (Source : in out Unbounded_String;
       Low    : in     Positive;
       High   : in     Natural;
-      By     : in     Unbounded_String;
-      From   : in     Positive;
-      To     : in     Natural);
+      By     : in     Unbounded_String);
    --  Identical in effect to
-   --    Replace_Slice (Source, Low, High, Slice (By, From, To));
+   --    Replace_Slice (Source, Low, High, To_String (By));
 
    function Insert
      (Source   : in Unbounded_String;
@@ -203,25 +157,6 @@
       New_Item : in     Unbounded_String);
    --  Identical in effect to Insert (Source, Before, To_String (New_Item));
 
-   function Insert
-     (Source   : in Unbounded_String;
-      Before   : in Positive;
-      New_Item : in Unbounded_String;
-      Low      : in Positive;
-      High     : in Natural)
-     return Unbounded_String;
-   --  Identical in effect to Insert (Source, Before,
-   --                                 Slice (New_Item, Low, High));
-
-   procedure Insert
-     (Source   : in out Unbounded_String;
-      Before   : in     Positive;
-      New_Item : in     Unbounded_String;
-      Low      : in     Positive;
-      High     : in     Natural);
-   --  Identical in effect to Insert (Source, Before,
-   --                                 Slice (New_Item, Low, High));
-
    function Overwrite
      (Source   : in Unbounded_String;
       Position : in Positive;
@@ -236,188 +171,163 @@
       New_Item : in     Unbounded_String);
    --  Identical in effect to
    --    Overwrite (Source, Position, To_String (New_Item));
-
-   function Overwrite
-     (Source   : in Unbounded_String;
-      Position : in Positive;
-      New_Item : in Unbounded_String;
-      Low      : in Positive;
-      High     : in Natural)
-     return Unbounded_String;
-   --  Identical in effect to Overwrite (Source, Position,
-   --                                    Slice (New_Item, Low, High));
-
-   procedure Overwrite
-     (Source   : in out Unbounded_String;
-      Position : in     Positive;
-      New_Item : in     Unbounded_String;
-      Low      : in     Positive;
-      High     : in     Natural);
-   --  Identical in effect to Overwrite (Source, Position,
-   --                                    Slice (New_Item, Low, High));
-
-   ...
 
-private
+Similar operations are added to Ada.Strings.Bounded.
 
-   ...
 
-end Ada.Strings.Unbounded;
+The following child package is defined:
 
-Implementation advice: all these new operations should be implemented such
-that no extra (intermediary) copy of the string (slice) data is created.
+with Ada.Strings.Unbounded;
+package Ada.Text_IO.Unbounded_IO is
 
-It is also proposed to add a child package to Ada.Strings.Unbounded:
-
-with Ada.Text_IO;
-
-package Ada.Strings.Unbounded.Text_IO is
-
   procedure Put
-    (File : in Ada.Text_IO.File_Type;
-     Item : in Unbounded_String);
+    (File : in File_Type;
+     Item : in Ada.Strings.Unbounded.Unbounded_String);
   --  Identical in effect to
   --    Ada.Text_IO.Put (File, To_String (Item));
 
   procedure Put
-    (Item : in Unbounded_String);
+    (Item : in Ada.Strings.Unbounded.Unbounded_String);
   --  Identical in effect to
   --    Ada.Text_IO.Put (To_String (Item));
 
   procedure Put_Line
     (File : in Ada.Text_IO.File_Type;
-     Item : in Unbounded_String);
+     Item : in Ada.Strings.Unbounded.Unbounded_String);
   --  Identical in effect to
   --    Ada.Text_IO.Put_Line (File, To_String (Item));
 
   procedure Put_Line
-    (Item : in Unbounded_String);
+    (Item : in Ada.Strings.Unbounded.Unbounded_String);
   --  Identical in effect to
   --    Ada.Text_IO.Put_Line (To_String (Item));
 
   function Get_Line
-    (File : in Ada.Text_IO.File_Type)
-    return Unbounded_String;
-  --  Reads up to the end of the line, returning the whole line as an
-  --  unbounded string. If a line terminator is met, Skip_Line is (in effect)
-  --  called with a spacing of 1, and the characters up to but not including
-  --  the line terminator are returned. If a file terminator is met, the
-  --  characters up to but not including the file terminator are returned,
-  --  except if the file terminator is met before any characters have been
-  --  read; in this case, Ada.IO_Exceptions.End_Error is raised.
+    (File : in File_Type)
+    return Ada.Strings.Unbounded.Unbounded_String;
+  -- Equivalent to:
+  -- declare
+  --     Buffer : String (1 .. String'Last);
+  --     Last : Natural;
+  -- begin
+  --     Get_Line (File, Buffer, Last);
+  --     return Ada.Strings.Unbounded.To_Unbounded_String(Buffer(1..Last));
+  -- end;
+  -- Note: This code will not work on most compilers.
 
   function Get_Line
-    return Unbounded_String;
+    return Ada.Strings.Unbounded.Unbounded_String;
   --  Identical to Get_Line (Ada.Text_IO.Current_Input);
 
-  ---------------------------------------------------------------------
-  -- Slice operations:
+  procedure Get_Line
+    (File : in File_Type; Item : in out Ada.Strings.Unbounded.Unbounded_String);
+  -- Equivalent to Item := Get_Line (File);
 
-  procedure Put
-    (File : in Ada.Text_IO.File_Type;
-     Item : in Unbounded_String;
-     Low  : in Positive;
-     High : in Natural);
-  --  Identical in effect to
-  --    Put (File, Slice (Item, Low, High));
+  procedure Get_Line
+    (Item : in out Ada.Strings.Unbounded.Unbounded_String);
+  -- Equivalent to Item := Get_Line;
 
-  procedure Put
-    (Item : in Unbounded_String;
-     Low  : in Positive;
-     High : in Natural);
-  --  Identical in effect to
-  --    Put (Slice (Item, Low, High));
-
-  procedure Put_Line
-    (File : in Ada.Text_IO.File_Type;
-     Item : in Unbounded_String;
-     Low  : in Positive;
-     High : in Natural);
-  --  Identical in effect to
-  --    Put_Line (File, Slice (Item, Low, High));
+end Ada.Text_IO.Unbounded_IO;
 
-  procedure Put_Line
-    (Item : in Unbounded_String;
-     Low  : in Positive;
-     High : in Natural);
-  --  Identical in effect to
-  --    Put_Line (Slice (Item, Low, High));
+There is a similar package for Ada.Wide_Text_IO.Wide_Unbounded_IO.
 
-end Ada.Strings.Unbounded.Text_IO;
+!wording
 
-Implementation advice: the Put and Put_Line operations should be implemented
-such that no extra copy of the string data occurs.
+Detailed wording changes are not yet provided.
 
-BTW: since Ada.Text_IO.End_Of_Line returns True when a line *or a file*
-terminator are next in the input (A.10.5(13)), I believe it would make sense
-to clearly define that Ada.Text_IO.Get_Line does *not* raise End_Error upon
-the last line of a file if that last line has no line terminator, but ends
-on EOF directly. Otherwise, it may get rather difficult to read the last
-line of such a file. In other words, define "end of the line" as "line
-terminator or EOF", and Get_Line to read up to the end of the line (and
-call Skip_Line (1) if it stopped on a line terminator, but not if it
-stopped on EOF).
+However, the existing Index routines ought to be described in terms of the
+new versions with the From parameter, not the other way around.
 
-It should also be evaluated whether similar additions as proposed above for
-bounded strings (Ada.Strings.Bounded) would make sense.
+Get_Line ought to be described in terms of words similar to the existing
+Get_Line, not as above.
 
 !discussion
 
-The point of the proposed additions is not so much missing functionality, as
-a user can always get the same functionality by converting the unbounded
-string (slice) to a plain String using To_String or Slice and then using the
-existing operation, but a sometimes significant efficiency gain by the new
-operations precisely because they avoid this clumsy method with an
-intermediary representation of one parameter as a String.
-
-All of these operations can be implemented very simply. As an example assume
-the implementation of unbounded strings suggested in the Rationale and consider
-for instance the last Overwrite variant proposed above:
+The new operations added to Ada.Strings.Fixed, Ada.Strings.Bounded, and
+Ada.Strings.Unbounded could potentially cause new ambiguities in programs if
+there is a use clause for the string package. However, this is unlikely,
+and no programs change meaning (any incompatibilities cause compile-time
+errors).
+
+
+The procedure version of To_Bounded_String and To_Unbounded_String probably
+would be better named 'Set'. However, that would increase the possibility of
+a name collision incompatibility, so we did not change the names.
+
+
+An earlier proposal for the Index functions was to add a defaulted From
+parameter to the end of the existing routine. This would look like:
+
+    function Index (Source : in String;
+                    Pattern : in String;
+                    Going : in Direction := Forward;
+                    Mapping : in Maps.Character_Mapping := Maps.Identity;
+                    From : in Positive := 1) return Natural;
+
+This has the advantage of not adding new routines. However, there are several
+serious drawbacks. First, this is significantly more incompatable than just
+adding new routines. Adding a parameter like this affects renames and
+overridings. One compiler vendor notes that they've seen derivations of
+Unbounded_Strings in their customer's code.
+
+Second, the correct default value is not clear. For Ada.Strings.Fixed, it
+depends on the bounds of Source and Going. Since a default value cannot
+depend on the values of other parameters, it is not possible to write the
+correct default value. For Ada.Strings.Bounded and Ada.Strings.Unbounded, the
+value depends on Going and Length(Source), which again is a problem. We
+could define the parameter to have type Natural, and define 0 to mean the
+start or end of Source as needed, but that seems very ugly and confusing.
+
+Thus, we added new routines with the From parameter as the last non-defaulted
+parameter.
+
+
+Ada.Text_IO.Unbounded_IO.Get_Line can be implemented as follows:
+
+     procedure Get_Line (File : in File_Type;
+         Item : in out Ada.Strings.Unbounded.Unbounded_String) is
+         Buffer : String (1 .. 80);
+         Last : Natural;
+     begin
+         Get_Line (File, Buffer, Last);
+         Ada.Strings.Unbounded.To_Unbounded_String (Item, Buffer(1..Last));
+         while Last = Buffer'Last loop
+             Get_Line (File, Buffer, Last);
+             Ada.Strings.Unbounded.Append (Item, Buffer(1..Last));
+         end loop;
+     end Get_Line;
+
+However, all of the I/O operations can be better implemented if they have
+access to the internal representation of the Unbounded_String type. That
+can be accomplished with an implementation-defined child package of
+Ada.Strings.Unbounded.
 
-   procedure Overwrite
-     (Source   : in out Unbounded_String;
-      Position : in     Positive;
-      New_Item : in     Unbounded_String;
-      Low      : in     Positive;
-      High     : in     Natural)
-   is
-   begin
-      if Low > New_Item.Reference'Last or High > New_Item.Reference'Last then
-         raise Ada.Strings.Index_Error;
-      end if;
-      Overwrite (Source, Position, New_Item.Reference (Low .. High));
-   end Overwrite;
 
-The I/O operations can be implemented similarly. E.g.
+Ada.Text_IO.Unbounded_IO is defined as a child of Text_IO to match the
+already existing Ada.Text_IO.Complex_IO. This makes the definition of a
+similar package for Bounded_Strings complex. It could be defined something
+like:
+
+with Ada.Strings.Bounded.Generic_Bounded_Length;
+generic
+    with package Bounded is new Ada.Strings.Bounded.Generic_Bounded_Length (<>);
+package Ada.Text_IO.Bounded_IO is
+
+  procedure Put
+    (File : in File_Type;
+     Item : in Bounded.Bounded_String);
 
-   procedure Put
-     (Item : in Unbounded_String)
-   is
-   begin
-      Ada.Text_IO.Put (Item.Reference.all);
-   end Put;
-
-   function Get_Line
-     (File : in Ada.Text_IO.File_Type)
-     return Unbounded_String
-   is
-      Result : Unbounded_String;
-      Buffer : String (1 .. 500); -- Or whatever size is deemed appropriate
-      Last   : Natural;
-   begin
-      loop
-         Ada.Text_IO.Get_Line (File, Buffer, Last);
-         Append (Result, Buffer (1 .. Last));
-         exit when Last < Buffer'Last or else Ada.Text_IO.End_Of_File (File);
-      end loop;
-      return Result;
-   end Get_Line;
-
-While the Get_Line operations could be written by a user, this is not possible
-for the Put and Put_Line operations, since there is no access to the internal
-component Reference. However, it seems only natural to provide the Get_Line,
-too.
+  ...
 
+end Ada.Text_IO.Bounded_IO;
+
+but this didn't seem to have sufficient benefit to mandate. (An implementation
+can add this package if it likes.) Note that we're never going to be totally
+consistent here, as Ada.Text_IO.Fixed_IO already exists for another purpose,
+and such a package would not make any sense anyway, as Text_IO already
+includes the needed operations.
+
+
 !example
 
 Consider the task of finding all occurrences of a given string Pattern in a
@@ -470,7 +380,6 @@
 
    Ada.Strings.Unbounded.Text_IO (My_Unbounded_String);
 
-Note: GNAT already provides the package Ada.Strings.Unbounded.Text_IO.
 
 !appendix
 
@@ -828,7 +737,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---    $Revision: 1.2 $                              --
+--                            $Revision: 1.3 $                              --
 --                                                                          --
 --          Copyright (C) 1992-1998, Free Software Foundation, Inc.         --
 --                                                                          --
@@ -914,4 +823,57 @@
 --  Add missing copyright line to header
 --  ----------------------------
 --  New changes after this line.  Each line starts with: "--  "
+
+****************************************************************
+
+From the minutes of the Vienna meeting:
+
+Randy explains that the readability of programs using unbounded strings is a
+problem, because you have to convert to type String to do anything interesting.
+
+Jean-Pierre comments that unbounded strings are really for storage; don't use
+them for manipulation. That doesn't seem to be the intent expressed in the
+standard.
+
+Tucker would like to see a procedure version of To_Unbounded_String. He also
+would like to add a defaulted starting parameter to all the Index functions.
+Pascal immediately claims that that is not compatible.
+
+Tucker hates making this look like an add-on. The new parameter would have to
+be at the end. In that case, only renames (and overriding via derivation) would
+be incompatible. These are unlikely.
+
+There is not much interest in the slice version of the operations that were
+proposed.
+
+The group feels that I/O is generally valuable. Complex has this, and it is a
+child of Text_IO. But you need access to the representation of unbounded
+string. So it appears that it has to be a child of Unbounded. Steve Baird
+objects, you could have an implementation package as a child of Unbounded.
+
+Thus, we settle on the name Ada.Text_IO.Unbounded_IO to make it like
+Complex_IO. It could be a rename from an implementation package. There also
+would be a wide version (Ada.Wide_Text_IO.Unbounded_IO), of course.
+
+The From parameter will need to be added to all index functions (for Fixed,
+Bounded, and Unbounded).
+
+****************************************************************
+
+From: Adam Beneschan [adam@irvine.com]
+Sent: Thursday, August 22, 2002 3:33 PM
+
+[Editor's note: This comment was sent on a different subject, but since it
+gives information about the real-world uses of Unbounded_Strings, I've also
+attached it here...]
+
+It may not be as weird as you think.  If Ada.Strings.Unbounded.-
+Unbounded_String (defined as untagged private) is implemented as a
+child of Ada.Finalization.Controlled (which is tagged), as suggested
+by the Rationale, then any package that tries to derive from
+Unbounded_String will run into this situation.  (We've seen real-life
+Ada code that does define types derived from Unbounded_String.)
+
+****************************************************************
+
 

Questions? Ask the ACAA Technical Agent