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

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

--- ai05s/ai05-0140-1.txt	2009/02/14 07:12:04	1.1
+++ ai05s/ai05-0140-1.txt	2009/03/07 04:55:42	1.2
@@ -1,5 +1,6 @@
-!standard 5.5                                       09-02-13  AI05-0140-1/01
+!standard 5.5                                       09-03-06  AI05-0140-1/02
 !class Amendment 09-02-13
+!status No Action (8-0-0) 09-02-22
 !status work item 09-02-13
 !status received 09-01-19
 !priority Medium
@@ -18,19 +19,20 @@
 declared in an interface, even when the function does nothing other
 than return a parameter.
 
+This omission means that designs are pushed into using procedures for
+routines that would rarely be overridden, even if a function is a more
+appropriate
+
 !proposal
 
 Add identity functions with new syntax:
 
     function Dereference (Pool : in out Root_Storage_Pool;
-                          Access_Value : in Address) return Address is identity (2);
-
-where "identity" is a new keyword and the number identifies the parameter to
-return.
+                          Access_Value : in Address)
+                     return Address is (Access_Value);
 
-[Editor's note: This was originally intended to be random musings in another
-proposal, but enough people were interested that we've elevated it to a
-real discussion item.]
+The parenthesized parameter name must have a type that statically matches
+the subtype of the function result.
 
 !wording
 
@@ -42,19 +44,28 @@
 that they provide a default implementation for an interface.
 
 Note that the parameter returned can't be of the interface type (it doesn't have
-any information to be returnable). We might need a rule to that effect.
+any information to be returnable). That follows from the static matching rule and
+the rules against functions that return an abstract type.
 
 
-An alternative to the specifying the parameter number would be to specify the
-name. That is:
+We'd probably want to consider an identity function default for generic formal
+subprograms as well.
 
+
+An alternative to the plain parenthesized expression would be to add a new keyword to
+make it crystal-clear that an identity function is being defined.
+
     function Dereference (Pool : in out Root_Storage_Pool;
                           Access_Value : in Address) return Address is identity (Access_Value);
 
+That seems especially important if we are using this as a default for generic formal
+subprograms:
 
-That might be clearer as to what is meant.
+    function Fooey (Value : in Natural) return Natural is (Value); -- Identity function default.
+    function Fooey (Value : in Natural) return Natural is Value; -- A function named Value is the default.
+    
 
-One could even make this a regular simple return statement:
+Another alternative would be to make this a regular simple return statement:
 
     function Dereference (Pool : in out Root_Storage_Pool;
                           Access_Value : in Address) return Address is return Access_Value;
@@ -198,4 +209,3 @@
 I hope it is clear where it goes...
 
 ****************************************************************
-

Questions? Ask the ACAA Technical Agent