CVS difference for ai12s/ai12-0009-1.txt

Differences between 1.6 and version 1.7
Log of other versions for file ai12s/ai12-0009-1.txt

--- ai12s/ai12-0009-1.txt	2016/06/07 00:09:15	1.6
+++ ai12s/ai12-0009-1.txt	2016/06/07 00:15:25	1.7
@@ -1,4 +1,4 @@
-!standard A.16(3/2)                             16-06-05    AI12-0009-1/04
+!standard A.16(3/2)                             16-06-06    AI12-0009-1/05
 !standard A.16(36.1/3)
 !standard A.16(98/2)
 !standard A.16(112.1/3)
@@ -43,10 +43,10 @@
    -- Directory Iteration
 
    type Directory_Listing is tagged limited private
-      with Preelaborable_Initialization,
-           Constant_Indexing => Current_Entry,
+      with Constant_Indexing => Current_Entry,
            Default_Iterator => Iterate,
            Iterator_Element => Directory_Entry_Type;
+   pragma Preelaborable_Initialization (Directory_Listing);
 
    function Entries
      (Directory : in String;
@@ -54,8 +54,8 @@
       Filter    : in Filter_Type := (others => True))
        return Directory_Listing;
 
-   type Cursor is private
-      with Preelaborable_Initialization;
+   type Cursor is private;
+   pragma Preelaborable_Initialization (Cursor);
 
    function Has_Entry
      (Position : in Cursor) return Boolean;
@@ -72,7 +72,6 @@
       Position : in Cursor) return Directory_Entry_Type
      with Pre => Has_Entry (Position);
 
-
 Modify A.16(98/2)
    The type Directory_Entry_Type represents a single item in a directory. These
    items can only be created {either }by the Get_Next_Entry procedure in this
@@ -84,17 +83,13 @@
 
 Append after A.16(112/3)
 
-   type Directory_Listing is tagged limited private
-      with Preelaborable_Initialization,
-           Constant_Indexing => Current_Entry,
-           Default_Iterator => Iterate,
-           Iterator_Element => Directory_Entry_Type;
+   type Directory_Listing is tagged limited private;
 
    The type Directory_Listing contains the state of a directory search.
    An object of type Directory_Listing can be used in generalized loop
    iteration (see 5.5.2) to visit each available directory entry for a
    particular directory search. A default-initialized Directory_Listing object
-   has no entries available. The type Directory_Listing need finalization.
+   has no entries available. The type Directory_Listing needs finalization.
 
    function Entries
      (Directory : in String;
@@ -118,8 +113,7 @@
    absence of Name_Error). When Start_Search propagates Name_Error or Use_Error,
    the return object will have no entries available.
 
-   type Cursor is private
-      with Preelaborable_Initialization;
+   type Cursor is private;
    
    A cursor is a reference to a directory entry within a directory listing. 
 
@@ -191,16 +185,16 @@
    use Name_Value_Pairs;
 
    type Environment_Variable_Listing is tagged limited private
-      with Preelaborable_Initialization,
-           Constant_Indexing => Current_Variable,
+      with Constant_Indexing => Current_Variable,
            Default_Iterator  => Iterate,
            Iterator_Element  => Name_Value_Pair_Type;
+   pragma Preelaborable_Initialization (Environment_Variable_Listing);
 
    function Environment
        return Environment_Variable_Listing;
 
-   type Cursor is private
-      with Preelaborable_Initialization;
+   type Cursor is private;
+   pragma Preelaborable_Initialization (Cursor);
 
    function Has_Environment_Variable
      (Position : in Cursor) return Boolean;
@@ -233,11 +227,7 @@
    function Value (Name_Value_Pair : in Name_Value_Pair_Type) return String;
    Returns the value of the environment variable represented by Name_Value_Pair.
 
-   type Environment_Variable_Listing is tagged limited private
-      with Preelaborable_Initialization,
-           Constant_Indexing => Current_Variable,
-           Default_Iterator => Iterate,
-           Iterator_Element => Name_Value_Pair_Type;
+   type Environment_Variable_Listing is tagged limited private;
 
    The type Environment_Variable_Listing contains the state of an environment
    variable search for the execution environment.
@@ -245,7 +235,7 @@
    loop iteration (see 5.5.2) to visit each environment variable from the
    external environment. A default-initialized Environment_Variable_Listing
    object represents all environment variables from the external environment.
-   The type Environment_Variable_Listing need finalization.
+   The type Environment_Variable_Listing needs finalization.
 
    If the external execution environment does not support environment variables,
    then Program_Error is propagated for generalized loop iteration.
@@ -257,8 +247,7 @@
    The exception Program_Error is propagated if the external execution environment
    does not support environment variables.
 
-   type Cursor is private
-      with Preelaborable_Initialization;
+   type Cursor is private;
    
    A cursor is a reference to an environment variable name value pair within
    an environment variable listing. 
@@ -1998,6 +1987,43 @@
 
 There were a few other minor changes as well, such as renaming the
 Entry_Presence type to a Cursor type, which I found reads a lot better now.
+
+****************************************************************
+
+From: Randy Brukardt
+Sent: Monday, June 6, 2016  7:10 PM
+
+> AI23-009-1
+
+I think I just had a Rip-van-Winkle moment. ;-)
+
+A couple of comments (I'll fix these in the posted draft, so you (Brad) don't
+have to):
+
+>  type Directory_Listing is tagged limited private
+>     with Preelaborable_Initialization,
+>          Constant_Indexing => Current_Entry,
+>          Default_Iterator => Iterate,
+>          Iterator_Element => Directory_Entry_Type;
+
+Preelaborable_Initialization is not an aspect; it is view-specific which
+doesn't map well to aspects. We tried and punted on it for Ada 2012. Perhaps
+we should try again to make it an aspect (separate AI, of course), but it
+certainly isn't one now. So you have to use the pragma. As in:
+
+  type Directory_Listing is tagged limited private
+     with Constant_Indexing => Current_Entry,
+          Default_Iterator => Iterate,
+          Iterator_Element => Directory_Entry_Type;
+  pragma Preelaborable_Initialization (Directory_Listing);
+
+There's some other places like that.
+
+In 112/3:
+
+>The type Directory_Listing need finalization.
+
+This should be "needs finalization".
 
 ****************************************************************
 

Questions? Ask the ACAA Technical Agent