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

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

--- ai12s/ai12-0208-1.txt	2019/02/22 06:50:38	1.20
+++ ai12s/ai12-0208-1.txt	2019/02/23 03:03:21	1.21
@@ -34,7 +34,7 @@
 The package Ada.Numerics.Big_Numbers has the following declaration:
 
    package Ada.Numerics.Big_Numbers
-      with Pure, Nonblocking
+      with Pure, Nonblocking, Global => null
    is
       subtype Field is Integer range 0 .. implementation-defined;
       subtype Number_Base is Integer range 2 .. 16;
@@ -47,8 +47,10 @@
 
    with Ada.Streams;
    package Ada.Numerics.Big_Numbers.Big_Integers
-      with Preelaborate, Nonblocking
-   is
+      with Preelaborate, Nonblocking,
+           Global => in out synchronized Big_Integers
+      is
+
       type Optional_Big_Integer is private with
         Default_Initial_Condition => not Is_Present (Optional_Big_Integer),
         Integer_Literal => From_String,
@@ -75,7 +77,7 @@
           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.]
+       We may need a straw poll to settle this one. ***]
 
 
       function "=" (L, R : Big_Integer) return Boolean;
@@ -88,6 +90,14 @@
       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))
                                   or else (Optional_Big_Positive > 0),
@@ -207,10 +217,10 @@
    with Ada.Numerics.Big_Numbers.Big_Integers;
    with Ada.Streams;
    package Ada.Numerics.Big_Numbers.Big_Reals
-      with Preelaborate, Nonblocking
-   is
-      use Big_Integers;
-
+      with Preelaborate, Nonblocking.
+           Global => in out synchronized Big_Integers
+      is
+ 
       type Optional_Big_Real is private with
         Default_Initial_Condition => not Is_Present (Optional_Big_Real),
         Real_Literal => From_String,
@@ -226,7 +236,8 @@
              Predicate_Failure => (raise Constraint_Error);
 
       function "/" (Num, Den : Big_Integer) return Big_Real
-        with Pre => (Den /= 0) or else (raise Constraint_Error);
+        with Pre => (if Big_Integers."/=" (Den, 0) 
+                     then raise Constraint_Error);
 
       function Numerator (Arg : Big_Real) return Big_Integer;
       function Denominator (Arg : Big_Real) return Big_Positive
@@ -238,10 +249,11 @@
       function To_Big_Real (Arg : Big_Integer) return Big_Real is
         (Arg / 1);
 
-      function "+" (Arg : Integer) return Big_Real
-        renames To_Big_Real;    -- **** Editor's note: This function is nonsense as written.
+      function "+" (Arg : Big_Integer) return Big_Real
+        renames To_Big_Real;
 
-      function To_Real (Arg : Integer) return Big_Real is ((+Arg) / 1);
+      function To_Real (Arg : Integer) return Big_Real is
+        (Big_Integers."+"(Arg) / 1);
 
       function "=" (L, R : Big_Real) return Boolean;
       function "<" (L, R : Big_Real) return Boolean;
@@ -291,6 +303,7 @@
         (Arg    : Big_Real;
          Stream : not null access Ada.Streams.Root_Stream_Type'Class);
 
+      function "+" (L : Big_Real) return Big_Real;
       function "-" (L : Big_Real) return Big_Real;
       function "abs" (L : Big_Real) return Big_Real;
       function "+" (L, R : Big_Real) return Big_Real;

Questions? Ask the ACAA Technical Agent