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

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

--- ai12s/ai12-0187-1.txt	2017/04/06 02:38:59	1.7
+++ ai12s/ai12-0187-1.txt	2017/11/22 04:31:18	1.8
@@ -1,4 +1,4 @@
-!standard 7.3.3(0)                                    17-04-05  AI12-0187-1/04
+!standard 7.3.3(0)                                    17-10-14  AI12-0187-1/05
 !standard 13.1.1(4/3)
 !class Amendment 16-06-02
 !status work item 16-06-02
@@ -102,10 +102,12 @@
 
 Static Semantics
 
-  A *property function* of a type T is a function with a single parameter, that
-  is a primitive operation of T or a function whose parameter is class-wide and
-  covers T. The return type of a property function is nonlimited.
+  A *property function* of type T is a function with a single parameter of
+  type T or class-wide type that covers T.
 
+  AARM Reason: This provides restrictions on name resolution so overloaded functions
+  can be used.
+
   For a private type, private extension, or full type that does not have a
   partial view, the following language-defined aspects may be specified with an
   aspect_specification (see 13.1.1):
@@ -113,8 +115,8 @@
   Stable_Properties
 
     This aspect shall be specified by a type_property_aspect_definition; each
-    name shall statically denote a property function of the type. This aspect
-    defines the *stable property functions* of the associated type.
+    name shall statically denote a single property function of the type. This
+    aspect defines the *stable property functions* of the associated type.
 
     AARM Discussion: We do not allow this aspect on generic formal types, as it
     is only meaningful for primitive subprograms and generic formal types have
@@ -127,8 +129,8 @@
   Stable_Properties'Class
 
     This aspect shall be specified by a type_property_aspect_definition; each
-    name shall statically denote a property function of the type. This aspect
-    defines the *class-wide stable property functions* of the associated type.
+    name shall statically denote a single property function of the type. This
+    aspect defines the *class-wide stable property functions* of the associated type.
     Redundant[Unlike most class-wide aspects, Stable_Properties'Class is not
     inherited by descendant types and subprograms, but the enhanced class-wide
     postconditions are inherited in the normal manner.]
@@ -151,14 +153,14 @@
   Stable_Properties
 
     This aspect shall be specified by a subprogram_property_aspect_definition;
-    each name shall statically denote a property function of a type for which
-    the associated subprogram is primitive.
+    each name shall statically denote a single property function of a type for
+    which the associated subprogram is primitive.
 
   Stable_Properties'Class
 
     This aspect shall be specified by a subprogram_property_aspect_definition;
-    each name shall statically denote a property function of a tagged type for
-    which the associated subprogram is primitive. Redundant[Unlike most
+    each name shall statically denote a single property function of a tagged
+    type for which the associated subprogram is primitive. Redundant[Unlike most
     class-wide aspects, Stable_Properties'Class is not inherited by descendant
     subprograms, but the enhanced class-wide postconditions are inherited in
     the normal manner.]
@@ -171,6 +173,13 @@
 
 Legality Rules
 
+  A stable property function of a type T (including a class-wide stable property
+  function) shall have a nonlimited return type and shall be:
+     * a primitive function with a single parameter of mode *in* of type T; or
+     * a function that is declared immediately within the declarative region in
+       which an ancestor type of T is declared and has a single parameter of mode
+       *in* of a class-wide type that covers T.
+
   In a subprogram_property_aspect_definition for a subprogram S:
     * all or none of the items shall be preceded by /not/;
 
@@ -318,10 +327,6 @@
 type (and not just primitives), then existing user-written routines that
 Open and Close file parameters would fail with Assertion_Error!
 
-It might make sense to extend that rule to cover class-wide routines with
-parameters of T'Class in the package with the declaration of T. That is
-messy enough that I didn't do it.
-
 (6) One could imagine a similar feature for preconditions. However, predicates
 already support that need, with the exception of existing code where
 compatibility is paramount (like Text_IO). [Using a predicate requires
@@ -619,5 +624,15 @@
 
 (I'll note that I promised to do that "next week" on Dec 29, so you're not
 the only one who can put off things indefinitely. ;-)
+
+****************************************************************
+
+From: Randy Brukardt
+Sent: Saturday, October 14, 2017  10:00 AM
+
+Here is a revised AI12-0187-1 [this is version /05 of the AI - ED], with most
+of the property function rules moved to Legality Rules. I left some as we
+need some for resolution rules (so overloaded functions can be named in these
+aspects).
 
 ***************************************************************

Questions? Ask the ACAA Technical Agent