comp.lang.ada
 help / color / mirror / Atom feed
From: "Norman H. Cohen" <ncohen@watson.ibm.com>
Subject: Re: Software Engineering News Brief
Date: 1996/11/18
Date: 1996-11-18T00:00:00+00:00	[thread overview]
Message-ID: <3290A899.2052@watson.ibm.com> (raw)
In-Reply-To: 01bbd490$356f8220$686700cf@ljelmore.montana


Larry J. Elmore wrote:

> I agree that it's unnecessary for Ada to directly support dates rtanging
> over thousands of years, but IMHO the 1900-2099 A.D. limit is just too
> small. For example, any program dealing with birthdates of people (and I'm
> thinking mainly in the health care field right now where many patients are
> elderly), many people alive today were born before 1900.

You are confused about the "direct support" that Ada provides for
dates.  Like any general-purpose programming language, Ada allows a
programmer to construct any representation of dates appropriate for his
application, e.g. a string of the form yyyymmdd, along with a set of
subprograms to manipulate that representation.  

In addition, since Ada is (among other things) a real-time programming
language, the standard Ada library includes a package named Calendar
with one particular representation--a type named Time capable of
representing any time from the year 1901 to the year 2099 to an accuracy
of 20 milliseconds or better (with a recommendation that implementations
provide a representation accurate to 0.1 milliseconds if the underlying
system supports it).  The operations of type Time are:

   - decomposing a Time value into year, month, day, and seconds
   - composing a Time value from these components
   - comparing two Time values for <, <=, = >=, or >
   - subtracting two Time values within 24 hours of each other to
        obtain a difference in seconds (of type Duration)
   - adding or subtracting a number of seconds in the range
        -86,400 to 86,400 (86,400 seconds = 1 day) to a Time value
        to obtain a new Time value 

That's it.  There are no operations to add a specified number of days,
years, or months to a Time value to obtain a time value, no operations
dealing with days of the week, etc.  Sure there are applications that
require such capabilities, but the Calendar package was never meant for
those applications.  Unless your health-care application has a
requirement to pinpoint the birth of somebody born in 1899 to within 20
milliseconds, I can't imagine why you would consider the type
Calendar.Time as the appropriate representation for birthdates.

On the other hand, Calendar.Time might be appropriate for a time-machine
control program if only the range were wider... ;-)

-- 
Norman H. Cohen
mailto:ncohen@watson.ibm.com
http://www.research.ibm.com/people/n/ncohen




  parent reply	other threads:[~1996-11-18  0:00 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-11-05  0:00 Software Engineering News Brief tmoran
1996-11-05  0:00 ` jimgregg
1996-11-05  0:00 ` Robert Dewar
1996-11-07  0:00   ` Stefan.Landherr
1996-11-11  0:00     ` Robert Dewar
1996-11-06  0:00 ` Tom Reid
1996-11-07  0:00   ` Robert Dewar
1996-11-07  0:00   ` Norman H. Cohen
1996-11-08  0:00   ` Robert I. Eachus
1996-11-09  0:00     ` Paul Eggert
1996-11-11  0:00       ` Norman H. Cohen
1996-11-16  0:00       ` Robert Dewar
1996-11-17  0:00         ` Fergus Henderson
1996-11-17  0:00           ` Robert Dewar
1996-11-17  0:00             ` Larry J. Elmore
1996-11-17  0:00               ` Robert Dewar
1996-11-18  0:00                 ` Keith Thompson
1996-11-18  0:00               ` Larry Kilgallen
1996-11-18  0:00                 ` Robert Rodgers
1996-11-18  0:00               ` Norman H. Cohen [this message]
1996-11-19  0:00                 ` Frank Manning
1996-11-18  0:00             ` Mark A Biggar
1996-11-18  0:00             ` Dave Sparks
1996-11-24  0:00             ` Paul Eggert
1996-11-24  0:00               ` Robert Dewar
1996-11-25  0:00                 ` Paul Eggert
1996-11-18  0:00         ` Matt Kennel
1996-11-19  0:00           ` Keith Thompson
1996-11-19  0:00           ` Martin Tom Brown
1996-11-21  0:00   ` Robert I. Eachus
  -- strict thread matches above, loose matches on Subject: below --
1996-11-12  0:00 Marin David Condic, 561.796.8997, M/S 731-93
1996-11-09  0:00 tmoran
1996-11-09  0:00 ` Robert Dewar
     [not found] <55t882$9m@news2.delphi.com>
1996-11-07  0:00 ` Robert Dewar
1996-11-07  0:00 tmoran
1996-11-07  0:00 ` Robert Dewar
1996-11-01  0:00 Software Engineering News
1996-11-01  0:00 ` Adam Beneschan
1996-11-05  0:00 ` David Bradley
1996-11-05  0:00   ` Larry Kilgallen
1996-11-05  0:00     ` Steve Jones - JON
1996-11-06  0:00   ` Ed Falis
1996-11-06  0:00 ` John Cosby
     [not found] ` <55rmsc$2ee$1@shade.twinsun.com>
1996-11-07  0:00   ` caip.rutgers.edu!halasz
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox