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

Differences between 1.21 and version 1.22
Log of other versions for file ai12s/ai12-0208-1.txt

--- ai12s/ai12-0208-1.txt	2019/02/23 03:03:21	1.21
+++ ai12s/ai12-0208-1.txt	2019/03/01 06:37:35	1.22
@@ -1,8 +1,9 @@
-!standard A.5.5(0)                                   19-02-22  AI12-0208-1/09
+!standard A.5.5(0)                                   19-02-26  AI12-0208-1/10
 !standard A.5.6(0)
 !standard A.5.7(0)
-!standard A.5.8(0)
 !class Amendment 16-12-19
+!status Amendment 1-2012 19-02-26
+!status ARG Approved 8-1-2  19-02-26
 !status work item 16-12-19
 !status received 16-09-27
 !priority Low
@@ -18,7 +19,6 @@
 have this capability in order to implement static expressions; shouldn't some
 such package be available to Ada users as well? (Yes.)
 
-
 !proposal
 
 (See Summary.)
@@ -52,33 +52,18 @@
       is
 
       type Optional_Big_Integer is private with
-        Default_Initial_Condition => not Is_Present (Optional_Big_Integer),
+        Default_Initial_Condition => not Is_Valid (Optional_Big_Integer),
         Integer_Literal => From_String,
         Put_Image => Put_Image;
 
-      function Is_Present (Arg : Optional_Big_Integer) return Boolean;
+      function Is_Valid (Arg : Optional_Big_Integer) return Boolean;
 
       subtype Big_Integer is Optional_Big_Integer
-        with Dynamic_Predicate => Is_Present (Big_Integer),
+        with Dynamic_Predicate => Is_Valid (Big_Integer),
              Predicate_Failure => (raise Constraint_Error);
-
-      function No_Big_Integer return Optional_Big_Integer
-        with Post => not Is_Present (No_Big_Integer'Result);
-
-      [TBD: Tuck does not like the names Is_Present and Null_Big_Integer
-      (and similarly for Is_Present and Null_Big_Rational). I don't know
-      how Tuck feels about No_Big_Integer (as opposed to Null_Big_Integer).
-      In private communication with Steve, the following alternatives were
-      discussed:
-          1) Is_Null and Null_Big_Integer
-          2) Augment #1 with a Not_Null function (i.e. provide both polarities,
-             like "=" and "/=").
-          3) Is_Valid and Invalid_Big_Integer.
-          4) Is_Defined and Undefined_Big_Integer.
-          5) Is_Present and Null_Big_Integer.
-          6) Is_Present and No_Big_Integer (as in the current proposal).
-       We may need a straw poll to settle this one. ***]
 
+      function Invalid_Big_Integer return Optional_Big_Integer
+        with Post => not Is_Valid (Invalid_Big_Integer'Result);
 
       function "=" (L, R : Big_Integer) return Boolean;
       function "<" (L, R : Big_Integer) return Boolean;
@@ -87,24 +72,14 @@
       function ">=" (L, R : Big_Integer) return Boolean;
 
       function To_Big_Integer (Arg : Integer) return Big_Integer;
-      function "+" (Arg : Integer) return Big_Integer
-        renames To_Big_Integer;
 
-      [Editor's note: This "+" operation means that a number like
-          +123_345_789_012_345_678
-       would make the program illegal, as it is converted to Integer.
-       OTOH, the value is legal without the "+". I find this a bit
-       annoying. I think I'd rather get rid of this overloading of "+"
-       (it seems to be a left-over from a pre-literal library)  and
-       add the missing unary operator. ***]
-
       subtype Optional_Big_Positive is Optional_Big_Integer
-        with Dynamic_Predicate => (not Is_Present (Optional_Big_Positive))
+        with Dynamic_Predicate => (not Is_Valid (Optional_Big_Positive))
                                   or else (Optional_Big_Positive > 0),
              Predicate_Failure => (raise Constraint_Error);
 
       subtype Optional_Big_Natural is Optional_Big_Integer
-        with Dynamic_Predicate => (not Is_Present (Optional_Big_Natural))
+        with Dynamic_Predicate => (not Is_Valid (Optional_Big_Natural))
 	                          or else (Optional_Big_Natural >= 0),
              Predicate_Failure => (raise Constraint_Error);
 
@@ -157,6 +132,7 @@
         (Arg    : Big_Integer;
          Stream : not null access Ada.Streams.Root_Stream_Type'Class);
 
+      function "+" (L : Big_Integer) return Big_Integer;
       function "-" (L : Big_Integer) return Big_Integer;
       function "abs" (L : Big_Integer) return Big_Integer;
       function "+" (L, R : Big_Integer) return Big_Integer;
@@ -218,21 +194,21 @@
    with Ada.Streams;
    package Ada.Numerics.Big_Numbers.Big_Reals
       with Preelaborate, Nonblocking.
-           Global => in out synchronized Big_Integers
+           Global => in out synchronized Big_Reals
       is
  
       type Optional_Big_Real is private with
-        Default_Initial_Condition => not Is_Present (Optional_Big_Real),
+        Default_Initial_Condition => not Is_Valid (Optional_Big_Real),
         Real_Literal => From_String,
         Put_Image => Put_Image;
 
-      function Is_Present (Arg : Optional_Big_Real) return Boolean;
+      function Is_Valid (Arg : Optional_Big_Real) return Boolean;
 
       function No_Big_Real return Optional_Big_Real
-        with Post => not Is_Present (No_Big_Real'Result);
+        with Post => not Is_Valid (No_Big_Real'Result);
 
       subtype Big_Real is Optional_Big_Real
-        with Dynamic_Predicate => Is_Present (Big_Real),
+        with Dynamic_Predicate => Is_Valid (Big_Real),
              Predicate_Failure => (raise Constraint_Error);
 
       function "/" (Num, Den : Big_Integer) return Big_Real
@@ -249,11 +225,8 @@
       function To_Big_Real (Arg : Big_Integer) return Big_Real is
         (Arg / 1);
 
-      function "+" (Arg : Big_Integer) return Big_Real
-        renames To_Big_Real;
-
       function To_Real (Arg : Integer) return Big_Real is
-        (Big_Integers."+"(Arg) / 1);
+        (Big_Integers.To_Big_Integer (Arg) / 1);
 
       function "=" (L, R : Big_Real) return Boolean;
       function "<" (L, R : Big_Real) return Boolean;

Questions? Ask the ACAA Technical Agent