CVS difference for ai05s/ai05-0136-1.txt

Differences between 1.1 and version 1.2
Log of other versions for file ai05s/ai05-0136-1.txt

--- ai05s/ai05-0136-1.txt	2009/02/05 04:36:31	1.1
+++ ai05s/ai05-0136-1.txt	2009/02/05 05:21:23	1.2
@@ -1,4 +1,4 @@
-!standard  A.18.18(1)                                09-02-04    AI05-0136-1/01
+!standard  A.18.18(1)                                09-02-04    AI05-0136-1/02
 !class Amendment 09-02-04
 !status work item 09-02-04
 !status received 09-01-27
@@ -188,6 +188,17 @@
                      Before   : in     Cursor;
                      Position : in     Cursor);
 
+   procedure Splice_Children (Target   : in out Tree;
+                              Parent   : in     Cursor;
+                              Before   : in     Cursor;
+                              Source   : in out Tree);
+
+   procedure Splice_Children (Target   : in out Tree;
+                              Parent   : in     Cursor;
+                              Before   : in     Cursor;
+                              Source   : in out Tree;
+                              Position : in out Cursor);
+
    procedure Splice_Children (Container: in out Tree;
                               Parent   : in     Cursor;
                               Before   : in     Cursor;
@@ -250,25 +261,28 @@
 
 The model is that every element in the tree has an associated doubly-linked list
 of children. Thus we provide almost all of the operations of the list container,
-each with an added Parent parameter. We did not change the names of the
+each with an added Parent parameter. We did not change the basic names of the
 operations for familiarity. We added "_Child" to each name in order to describe
 clearly what is being accessed. We considered leaving the names the same
 (without the "_Child" suffix), but that seemed confusing, as it would be easy to
 believe that First always represents the first node of the root of the tree.
 
-Leaving off "_Child" also allows some operations to be defined over the entire
-tree, such as Find, and some versions of iterate.
+Having "_Child" as part of the names also opens up the possibility of operations
+not having the "_Child" suffix. These would naturally operate on the entire tree.
+We're taken advantage of this to define operations like Find and Iterate over the
+entire tree.
 
 Note that the root of the tree is also a list of elements. (Thus the tree is
 multirooted as well as multiway.) We considered allowing only a single root
 node, but it seemed inconsistent for no important reason, and moreover, allowing
 additional roots allows bottom-up tree creation where subtrees are stashed in
 the root until their parent is created (at which time Slice_Child would be used
-to make it subtree of the parent).
+to make it a subtree of the appropriate parent).
 
 Note that AI05-0001-1 proposes to add some new routines to all of the existing
 containers; these weren't included in this proposal but presumably would be
-included. Similarly, we expect that a bounded form would be provided.
+included. Similarly, we expect that a bounded form would be provided if
+AI05-0001-1 is adopted.
 
 For all of the subprograms that take a Parent parameter, if the parameter is
 No_Element, the node is inserted at the root of the tree. This is consistent
@@ -278,7 +292,9 @@
 Notes on specific subprograms:
 
 Operations that were dropped are: Swap and Swap_List; Reverse_Elements; and the
-sorting operations.
+sorting operations. These could have been defined, but they seem strange operating
+on a single list of children; they seem more like operations for an entire
+container (where they make no sense).
 
 Delete is provided to delete an arbitrary node from the tree. We don't provide a
 Count parameter on that routine, because it is not obvious what is being counted
@@ -430,27 +446,32 @@
    Header, HTML_Body, Paragraph, Working: HTML_Tree.Cursor;
 
    HTML_Tree.Insert_Child (Sample, Parent => HTML_Tree.No_Element, Position => Header,
+     Before => HTML_Tree.No_Element,
      New_Element => Header_HTML_Element'(Init_Element with null record));
    HTML_Tree.Insert_Child (Sample, Parent => Header, Position => HTML_Body,
+     Before => HTML_Tree.No_Element,
      New_Element => Body_HTML_Element'(Init_Element with null record));
    HTML_Tree.Insert_Child (Sample, Parent => HTML_Body, Position => Paragraph,
+     Before => HTML_Tree.No_Element,
      New_Element => Div_HTML_Element'(Init_Element with Class => "Text-Header", Style => ""));
-   HTML_Tree.Insert_Child (Sample, Parent => Paragraph,
+   HTML_Tree.Append_Child (Sample, Parent => Paragraph,
      New_Element => Text'(Init_Element with The_Text => "Sample HTML"));
-   HTML_Tree.Insert_Child (Sample, Parent => HTML_Body, Position => Working,
+   HTML_Tree.Insert_Child (Sample, Parent => HTML_Body, Position => Paragraph,
+     Before => HTML_Tree.No_Element,
      New_Element => Div_HTML_Element'(Init_Element with Class => "Text-Body", Style => ""));
-   Paragraph := Working;
-   HTML_Tree.Insert_Child (Sample, Parent => Paragraph, Position => Working,
+   HTML_Tree.Append_Child (Sample, Parent => Paragraph,
      New_Element => Text'(Init_Element with The_Text => "This is normal text; "));
-   HTML_Tree.Insert_Child (Sample, Parent => Working, Position => Working,
+   HTML_Tree.Insert_Child (Sample, Parent => Paragraph, Position => Working,
+     Before => HTML_Tree.No_Element,
      New_Element => Bold_HTML_Element'(Init_Element with null record));
-   HTML_Tree.Insert_Child (Sample, Parent => Working,
+   HTML_Tree.Append_Child (Sample, Parent => Working,
      New_Element => Text'(Init_Element with The_Text => "this is bold text"));
-   HTML_Tree.Insert_Child (Sample, Parent => Paragraph, Position => Working,
+   HTML_Tree.Insert_Child (Sample, Parent => Paragraph,
      New_Element => Text'(Init_Element with The_Text => "; and "));
    HTML_Tree.Insert_Child (Sample, Parent => Paragraph, Position => Working,
+     Before => HTML_Tree.No_Element,
      New_Element => Italic_HTML_Element'(Init_Element with null record));
-   HTML_Tree.Insert_Child (Sample, Parent => Working,
+   HTML_Tree.Append_Child (Sample, Parent => Working,
      New_Element => Text'(Init_Element with The_Text => "this is italic text"));
 
 Outputing the original HTML could be accomplished as follows:

Questions? Ask the ACAA Technical Agent