caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Richard Jones <rich@annexia.org>
To: William Lovas <wlovas@stwing.upenn.edu>, caml-list@inria.fr
Subject: Re: [Caml-list] ANNOUNCE: Library for handling Gregorian date calculations
Date: Sun, 24 Oct 2004 22:13:13 +0100	[thread overview]
Message-ID: <20041024211313.GB22047@annexia.org> (raw)
In-Reply-To: <20041024203159.GA28136@force.stwing.upenn.edu>

[-- Attachment #1: Type: text/plain, Size: 2134 bytes --]

On Sun, Oct 24, 2004 at 04:31:59PM -0400, William Lovas wrote:
> On Sun, Oct 24, 2004 at 08:07:32PM +0100, Richard Jones wrote:
> > I'm pleased to announce GregorianDate, which is a pure Objective CAML
> > library for handling calculations on the Gregorian calendar.
> 
> This looks cool, but i have a few suggestions.  First, it needs some online
> documentation (beyond the examples), preferrably in ocamldoc format.

Yes, you're right, but I'm quite busy at the moment.  There is
ocamldoc documentation in the tarball itself, and for an online
reference you should look at:

http://search.cpan.org/dist/Date-Calc/Calc.pod#DESCRIPTION

The API is pretty much identical, except that I have omitted Steffen's
time functions which really don't belong in this library.

> In
> particular, the following examples weren't transparent to me (a date
> non-specialist):
> 
> > # business_of_standard (2004, 10, 24);;
> > - : (int * int) * int = ((2004, 43), 7)
[Sunday (7) in week 43 of year 2004.]
> > # nth_weekday_of_month (2004, 10) 7 4;;
> > - : int * int * int = (2004, 10, 24)
[Calculate the 4th Sunday (7) in October 2004.]
>
> I don't know what a "business" date is, and 10-24-2004 isn't a weekday.
> Actually, i think i just understood "nth_weekday_of_month", but
> documentation would certainly have been helpful.

For reference, business weeks are defined in ISO 8601, and you can
find a synopsis here:

http://www.cl.cam.ac.uk/~mgk25/iso-time.html

> > # day_of_week (2004, 10, 24);;
> > - : int = 7
> > etc.
> 
> Also, you might consider enriching the interface with some types: i'd say
> at least that day of the week ought to be a variant.  This not only makes
> thing safer, but also makes the intended behavior of functions like
> "nth_weekday_of_month" more apparent.

Rich.

-- 
Richard Jones.  http://www.annexia.org/  http://www.j-london.com/
>>>   http://www.team-notepad.com/ - collaboration tools for teams   <<<
Merjis Ltd. http://www.merjis.com/ - improving website return on investment
Write Apache modules in OCaml - http://www.merjis.com/developers/mod_caml

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  parent reply	other threads:[~2004-10-24 21:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-24 19:07 Richard Jones
     [not found] ` <20041024203159.GA28136@force.stwing.upenn.edu>
2004-10-24 21:13   ` Richard Jones [this message]
2004-10-25  1:01 ` james woodyatt
2004-10-25 12:06 ` Julien Signoles
2004-10-26  2:11   ` N. Owen Gunden
2004-10-29  3:33     ` N. Owen Gunden
2004-10-29  6:25       ` Richard Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041024211313.GB22047@annexia.org \
    --to=rich@annexia.org \
    --cc=caml-list@inria.fr \
    --cc=wlovas@stwing.upenn.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).