CVS difference for ai05s/ai05-0228-1.txt
--- ai05s/ai05-0228-1.txt 2010/11/18 06:01:11 1.2
+++ ai05s/ai05-0228-1.txt 2010/11/20 02:45:34 1.3
@@ -1,4 +1,4 @@
-!standard 3.3.1(11) 10-11-17 AI05-0228-1/02
+!standard 3.3.1(11) 10-11-19 AI05-0228-1/03
!standard 3.3.1(12)
!standard 3.3.1(21)
!standard 3.5(56/2)
@@ -18,7 +18,7 @@
!problem
-The new predicate (see AI05-0153-1) and invariant (see AI05-0146-1) aspects
+The new predicate (see AI05-0153-3) and invariant (see AI05-0146-1) aspects
provide unreliable results for objects that are not initialized. This can be
prevented when a default initial value is provided.
@@ -43,6 +43,10 @@
aspect specified is the value of that aspect converted to the nominal subtype
(which might raise Constraint_Error - see 4.6, “Type Conversions”);
+AARM Ramification: This is a dynamic semantics rule, so the visibility of the
+aspect specification is not relevant -- if the full type for a private type has
+the Default_Value aspect specified, partial views of the type also have this
+implicit initial value.
Modify 3.3.1(13):
@@ -148,15 +152,6 @@
or if the component is that of an array type that have the Default_Component_Value
aspect specified.
-[Question: There does not seem to be any corresponding rule for elementary 'Read.
-That means that it is possible to stream in values not in italized T. That seems bad for
-types that have implicit initial values. For access and integer types, there cannot be
-values that are not in italized T (no null exclusion is applied, and T'Base covers all
-possible bit patterns for integers). But that is definitely not the case for enumeration
-and floating point types. Should there be some sort of check here in those cases? This
-seems to be the only non-erroneous way of creating an invalid value for such types, other
-than by using unchecked programming. -- Randy.]
-
!discussion
It is important that the default initial value be something that makes sense for
@@ -174,15 +169,11 @@
Providing a default initial value for an enumeration type with an unknown value:
type Item_State is (Unknown, Fooey, Blarch, ...) with Default_Value => Unknown;
-
-Providing a default initial value for an access type with a null exclusion (in
-Ada 2005, any default initialized object of this type would raise
-Constraint_Error):
- type My_Access is not null access My_Rec with Default_Value => Unknown_Ptr;
- Unknown_Ptr : constant My_Access := new My_Rec'(Kind => Unknown);
+Providing string type that is initialized with blanks:
-This is taking advantage of the deferred resolution of aspects.
+ type Blank_String is array (Positive range <>) of Character with
+ Default_Component_Value => ' ';
!ACATS test
Questions? Ask the ACAA Technical Agent