[m-rev.] calendar module proposal

Julien Fischer juliensf at csse.unimelb.edu.au
Tue Jan 27 17:54:57 AEDT 2009


On Tue, 27 Jan 2009, Ian MacLarty wrote:

> On Tue, Jan 27, 2009 at 04:38:52PM +1100, Ralph Becket wrote:
>> This looks good.
>>
>> Ian MacLarty, Tuesday, 27 January 2009:
>>> Hi,
>>>
>>> Here's a proposal for a calendar module for the standard library.
>>> Could interested people take a look and give me some feedback?
>>> Since this module only implements the Gregorian calendar, it might not
>>> be suitable for working with dates prior to 1582.  Perhaps it should be
>>> renamed to gregorian_calendar or gcalendar?
>>>
>>> Ian.
>>>
>>> Index: library/calendar.m
>>> ===================================================================
>>> RCS file: library/calendar.m
>>> diff -N library/calendar.m
>>> --- /dev/null	1 Jan 1970 00:00:00 -0000
>>> +++ library/calendar.m	27 Jan 2009 03:51:25 -0000
>>> @@ -0,0 +1,961 @@
>>> +%-----------------------------------------------------------------------------%
>>> +% vim: ft=mercury ts=4 sw=4 et wm=0 tw=0
>>> +%-----------------------------------------------------------------------------%
>>> +% Copyright (C) 2009 The University of Melbourne.
>>> +% This file may only be copied under the terms of the GNU Library General
>>> +% Public License - see the file COPYING.LIB in the Mercury distribution.
>>> +%-----------------------------------------------------------------------------%
>>> +%
>>> +% File: calendar.m.
>>> +% Main authors: maclarty
>>> +% Stability: low.
>>> +%
>>> +% Proleptic Gregorian calendar utilities.
>>
>> Can prolepsy be cured with antibiotics?
>>
>
> No, but it might be cured by implementing a hybrid Julian/Gregorian
> calendar.  Such a calendar would use the Julian system before a given
> crossover date and the Gregorian system after this date.  The crossover
> date would need to be changable, because different countries started
> using the Gregorian calendar at different times.  This cure would have
> the side-effects of a more complicated interface and implementation.

Premsuably the latter is exactly why that was what was done in the
Java API!  (See: http://java.sun.com/javase/6/docs/api/java/util/GregorianCalendar.html>).

Is it just matter of (optionally) allowing the crossover date to be set
when creating dates and durations?

Julien.
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list