CVS difference for ais/ai-00351.txt

Differences between 1.3 and version 1.4
Log of other versions for file ais/ai-00351.txt

--- ais/ai-00351.txt	2004/02/04 00:51:13	1.3
+++ ais/ai-00351.txt	2004/02/21 04:15:10	1.4
@@ -1,4 +1,4 @@
-!standard  9.06(19)                                     03-12-08  AI95-00351/02
+!standard  9.06(19)                                     04-02-16  AI95-00351/03
 !class amendment 03-09-22
 !status work item 03-09-22
 !status received 03-09-22
@@ -74,6 +74,8 @@
       ..
       366*(1+Year_Number'last - Year_Number'first);
 
+    subtype Leap_Seconds_Count  is Integer range -999 .. 999;
+
     procedure Difference (Left, Right : Time;
                           Days : out Day_Count;
                           Seconds : out Duration;
@@ -89,7 +91,7 @@
 
 end Ada.Calendar.Arithmetic;
 
-with Ada.Calendar.Time_Zones;
+with Ada.Calendar.Arithmetic, Ada.Calendar.Time_Zones;
 package Ada.Calendar.Formatting is
 
     -- Day of the week:
@@ -105,22 +107,21 @@
     subtype Minute_Number       is Natural range 0 .. 59;
     subtype Second_Number       is Natural range 0 .. 59;
     subtype Second_Duration     is Day_Duration range 0.0 .. 1.0;
-    subtype Leap_Seconds_Count  is Integer range -999 .. 999;
 
     function Hour       (Date : in Time;
-                         Time_Zone  : in Time_Zones.Time_Zone := 0)
+                         Time_Zone  : in Time_Zones.Time_Offset := 0)
                             return Hour_Number;
 
     function Minute     (Date : in Time;
-                         Time_Zone  : in Time_Zones.Time_Zone := 0)
+                         Time_Zone  : in Time_Zones.Time_Offset := 0)
                             return Minute_Number;
 
     function Second     (Date : in Time;
-                         Time_Zone  : in Time_Zones.Time_Zone := 0)
+                         Time_Zone  : in Time_Zones.Time_Offset := 0)
                             return Minute_Number;
 
-    function Sub_Second (Date : in Time) return Second_Duration;
-                         Time_Zone  : in Time_Zones.Time_Zone := 0)
+    function Sub_Second (Date : in Time;
+                         Time_Zone  : in Time_Zones.Time_Offset := 0)
                             return Second_Duration;
 
     function Seconds_Of (Hour : in Hour_Number;
@@ -136,7 +137,7 @@
                      Sub_Second : out Second_Duration);
 
     procedure Split (Date       : in Time;
-                     Time_Zone  : in Time_Zones.Time_Zone := 0;
+                     Time_Zone  : in Time_Zones.Time_Offset := 0;
                      Year       : out Year_Number;
                      Month      : out Month_Number;
                      Day        : out Day_Number;
@@ -153,7 +154,7 @@
 		      Second     : Second_Number;
 		      Sub_Second : Second_Duration := 0.0;
                       Leap_Second: Boolean := False;
-                      Time_Zone  : in Time_Zones.Time_Zone := 0);
+                      Time_Zone  : in Time_Zones.Time_Offset := 0)
 			      return Time;
 
     function Time_Of (Year       : Year_Number;
@@ -161,11 +162,11 @@
   		      Day        : Day_Number;
 		      Seconds    : Day_Duration;
                       Leap_Second: Boolean := False;
-                      Time_Zone  : in Time_Zones.Time_Zone := 0);
+                      Time_Zone  : in Time_Zones.Time_Offset := 0)
 			      return Time;
 
     procedure Split (Date       : in Time;
-                     Time_Zone  : in Time_Zones.Time_Zone := 0;
+                     Time_Zone  : in Time_Zones.Time_Offset := 0;
                      Year       : out Year_Number;
                      Month      : out Month_Number;
                      Day        : out Day_Number;
@@ -176,7 +177,7 @@
                      Leap_Second: out Boolean);
 
     procedure Split (Date       : in Time;
-                     Time_Zone  : in Time_Zones.Time_Zone := 0;
+                     Time_Zone  : in Time_Zones.Time_Offset := 0;
                      Year       : out Year_Number;
                      Month      : out Month_Number;
                      Day        : out Day_Number;
@@ -239,15 +240,14 @@
     Otherwise, all values are non-negative.
 
     AARM Note: The number of days is calculated midnight-to-midnight.
-    Leap_Seconds are not included in Seconds.
+    Leap_Seconds, if any, are not included in Seconds.
 
 function "+" (Left : Time; Right : Day_Count) return Time;
 function "+" (Left : Day_Count; Right : Time) return Time;
     Add a number of days to a time value. Time_Error is raised
     if the result is not representable as a value of type Time.
 
-function "-" (Left : Time; Right : Day_Count)
-    return Time;
+function "-" (Left : Time; Right : Day_Count) return Time;
     Subtract a number of days from a time value. Time_Error is raised
     if the result is not representable as a value of type Time.
 
@@ -261,24 +261,24 @@
     Day values of Time.
 
 function Hour       (Date : in Time;
-                     Time_Zone  : in Time_Zones.Time_Zone := 0)
+                     Time_Zone  : in Time_Zones.Time_Offset := 0)
                         return Hour_Number;
     Returns the hour for Date, as appropriate the specified timezone.
 
 function Minute     (Date : in Time;
-                     Time_Zone  : in Time_Zones.Time_Zone := 0)
+                     Time_Zone  : in Time_Zones.Time_Offset := 0)
                         return Minute_Number;
     Returns the minute within the hour for Date, as appropriate to the
     specified timezone.
 
 function Second     (Date : in Time;
-                     Time_Zone  : in Time_Zones.Time_Zone := 0)
+                     Time_Zone  : in Time_Zones.Time_Offset := 0)
                         return Minute_Number;
     Returns the second within the hour and minute for Date, as appropriate to
     the specified timezone.
 
-function Sub_Second (Date : in Time) return Second_Duration;
-                     Time_Zone  : in Time_Zones.Time_Zone := 0)
+function Sub_Second (Date : in Time;
+                     Time_Zone  : in Time_Zones.Time_Offset := 0)
                         return Second_Duration;
     Returns the fraction of second for Date. (This has the same accuracy as
     Day_Duration), as appropriate to the specified timezone.
@@ -300,7 +300,7 @@
     Split Seconds into Hour:Minute:Second.Sub_Second.
 
 procedure Split (Date       : in Time;
-                 Time_Zone  : in Time_Zones.Time_Zone := 0;
+                 Time_Zone  : in Time_Zones.Time_Offset := 0;
                  Year       : out Year_Number;
                  Month      : out Month_Number;
                  Day        : out Day_Number;
@@ -319,7 +319,7 @@
 		  Second     : Second_Number;
 		  Sub_Second : Second_Duration := 0.0;
                   Leap_Second: Boolean := False;
-                  Time_Zone  : in Time_Zones.Time_Zone := 0);
+                  Time_Zone  : in Time_Zones.Time_Offset := 0)
 			  return Time;
     Returns a Time built from the date and time values, relative to the
     specified timezone. Time_Error is raised if Leap_Second is True,
@@ -329,21 +329,21 @@
     UTC in ISO notation. So, if the timezone is UTC, if any of Hour /= 23,
     Minute /= 59, or Second /= 59, then Time_Error should be raised.
     However, we do not say that, because other time zones will have different
-    values for them.
+    values where a leap second is allowed.
 
 function Time_Of (Year       : Year_Number;
 	          Month      : Month_Number;
   		  Day        : Day_Number;
 		  Seconds    : Day_Duration;
                   Leap_Second: Boolean := False;
-                  Time_Zone  : in Time_Zones.Time_Zone := 0);
+                  Time_Zone  : in Time_Zones.Time_Offset := 0)
 			  return Time;
     Returns a Time built from the date and time values, relative to the
     specified timezone. Time_Error is raised if Leap_Second is True,
     and Seconds is not appropriate for a Leap_Second.
 
 procedure Split (Date       : in Time;
-                 Time_Zone  : in Time_Zones.Time_Zone := 0;
+                 Time_Zone  : in Time_Zones.Time_Offset := 0;
                  Year       : out Year_Number;
                  Month      : out Month_Number;
                  Day        : out Day_Number;
@@ -357,7 +357,7 @@
     true if Date identifies a leap second.
 
 procedure Split (Date       : in Time;
-                 Time_Zone  : in Time_Zones.Time_Zone := 0;
+                 Time_Zone  : in Time_Zones.Time_Offset := 0;
                  Year       : out Year_Number;
                  Month      : out Month_Number;
                  Day        : out Day_Number;
@@ -374,7 +374,7 @@
     other than Year is a 2 digit form of the value of the functions
     defined in Calendar and Calendar.Formatting, including a leading '0',
     if needed. Year is a 4 digit value.
-    If Include_Time_Fraction is True, and Sub_Seconds*100 is suffixed to the
+    If Include_Time_Fraction is True, Sub_Seconds*100 is suffixed to the
     string as a 2 digit value following a '.'.
 
     AARM Note: The Image provides a string in ISO 8601 format, the
@@ -400,7 +400,7 @@
 
 function Image (Elapsed_Time : Duration;
                 Include_Time_Fraction : in Boolean := False) return String;
-    Returns a string form of the
+    Returns a string form of the Elapsed_Time.
     The format is "Hours:Minute:Second", where each value
     is a 2 digit form of the value, including a leading '0', if needed.
     If Include_Time_Fraction is True, and Sub_Seconds*100 is suffixed to the
@@ -432,8 +432,8 @@
 ambiguities to many existing programs. (There are many new overloadings of
 Split and Time_Of.) In addition, while Ada.Calendar may be included in many
 programs, these operations are less likely to be needed and their overhead
-should not burden existing programs. The package should be a child, and not
-a stand-alone package, so that its implementation can take advantage of the
+should not burden existing programs. The packages should be a child, and not
+stand-alone packages, so that their implementation can take advantage of the
 internal representation of type Time.
 
 These operations are most valuable for wall clock time and date values. Thus,
@@ -3891,6 +3891,52 @@
 sensible and useful form. However, I must admit, this also suggests that it
 probably still contains faults, so some eagle eyes (and minds) may be in
 order when appraising it.
+
+****************************************************************
+
+From: Martin Dowie
+Sent: Monday, February 16, 2004  8:17 AM
+
+I've found a few 'bugettes' in AI-351. I thought I'd e-mail them direct to you,
+as I'm sure if I draw people to this AI on Ada-Comment, it will just start a
+long an unproductive thread (again). In apparent descending order of importance:
+
+1) Ada.Calendar.Time_Zones [ACTZ]: Ada.Calendar.Formatting [ACF] uses a type
+   "Time_Zones.Time_Zone" but ACTZ does actually define such a type;
+
+2) Ada.Calendar.Arithmetic [ACA]: Leap_Seconds_Count used but not defined;
+
+3) Couple of typos in ACF, e.g.
+    function Sub_Second (Date : in Time) return Second_Duration;
+                         Time_Zone  : in Time_Zones.Time_Zone := 0)
+                            return Second_Duration;
+   Should there be 1 parameter or 2? I'm guessing 2.
+
+   function Time_Of (Year       : Year_Number;
+                     Month      : Month_Number;
+                     Day        : Day_Number;
+                     Hour       : Hour_Number;
+                     Minute     : Minute_Number;
+                     Second     : Second_Number;
+                  Sub_Second : Second_Duration := 0.0;
+                      Leap_Second: Boolean := False;
+                      Time_Zone  : in Time_Zones.Time_Zone := 0);
+                        return Time;
+   Extra semi-colon before 'return Time' - this happens a couple of times.
+
+If you think they (the first 2) are worth bring to the attention of Ada-Comment
+then feel free to forward them on.
+
+****************************************************************
+
+From: Martin Dowie
+Sent: Monday, February 16, 2004  8:12 AM
+
+> 2) Ada.Calendar.Arithmetic [ACA]: Leap_Seconds_Count used but
+> not defined;
+
+Ah, ok, it is defined in ACF, so this needs to be added to ACA's
+context clause in the AI.
 
 ****************************************************************
 

Questions? Ask the ACAA Technical Agent