comp.lang.ada
 help / color / mirror / Atom feed
From: Reinert Korsnes <reinert.korsnes@GETRIDOFSPAMchello.no>
Subject: Re: ada calendar
Date: Mon, 08 Dec 2003 08:49:29 +0100
Date: 2003-12-08T08:49:29+01:00	[thread overview]
Message-ID: <br1ag1$frn$1@dolly.uninett.no> (raw)
In-Reply-To: bqr6rm$26k91c$1@ID-25716.news.uni-berlin.de

Nick Roberts wrote:

> Stephen Leake wrote:
> 
>>>how can i add one week to clendar.time record using duration ?
>> 
>> with Ada.Calendar; use Ada.Calendar;
>> procedure One_Week
>> is
>>    One_Minute : constant Duration := 60.0;
>>    One_Hour   : constant Duration := 60 * One_Minute;
>>    One_Day    : constant Duration := 24 * One_Hour;
>>    One_Week   : constant Duration := 7 * One_Day;
>> 
>>    Now : Time := Clock;
>> begin
>>    Now := Now + One_Week;
>> end One_Week;
> 
> This may work on some implementations. If it fails, the compiler should
> issue a fatal error. In this case, Tom Moran's suggestion:
> 
>     One_Minute : constant Duration := 60.0;
>     One_Hour   : constant Duration := 60 * One_Minute;
>     One_Day    : constant Duration := 24 * One_Hour;
> 
>     Now : Time := Clock;
>     begin
>        for Day in 1 .. 7 loop
>          Now := Now + One_Day;
>        end loop;
> 
> ought to work. There is a proposal to add this functionality in the next
> revision of the language (AI-351).
> 

Will this revision include definitions based on precise
description of movements of the Earth ?  The rotation
of the Earth is not so well defined and if one wants very
high precision - as one may want within some applications
of theoretical (geo-)physics/astronomy - then I guess such
calendar definitions cannot be implemented in a computer language ?

The "Ada calender" will be more like the "official/standard calendar" -
but this is subject to frequent modifications ?

Or does there exist a stable calendar standard which everybody agree on ? 

reinert




  reply	other threads:[~2003-12-08  7:49 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-05 21:00 ada calendar shoko
2003-12-05 22:34 ` Stephen Leake
2003-12-06  0:11   ` Nick Roberts
2003-12-08  7:49     ` Reinert Korsnes [this message]
2003-12-09  7:40       ` tmoran
2003-12-09 15:59         ` Nick Roberts
2003-12-10  8:16           ` Robert I. Eachus
2003-12-10 12:27             ` Thomas Wolf
2003-12-18 19:03               ` Randy Brukardt
2003-12-05 22:55 ` tmoran
2003-12-06  0:01   ` Marius Amado Alves
2003-12-06  0:21     ` tmoran
2003-12-06 15:08       ` Marius Amado Alves
2003-12-06 16:10 ` David C. Hoos
  -- strict thread matches above, loose matches on Subject: below --
2003-12-06 15:53 shoko
2003-12-06 17:01 ` Marius Amado Alves
2003-12-08 19:22   ` Pascal Obry
2003-12-09  4:48     ` Nick Roberts
2003-12-09 13:23       ` Wes Groleau
2003-12-07  2:49 ` Jeffrey Carter
2003-12-07 12:36   ` Duncan Sands
replies disabled

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