caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] date manipulation library
@ 2003-09-15 14:37 Alan Schmitt
  2003-09-15 14:48 ` Antoine Schweitzer-Chaput
                   ` (4 more replies)
  0 siblings, 5 replies; 26+ messages in thread
From: Alan Schmitt @ 2003-09-15 14:37 UTC (permalink / raw)
  To: caml-list

Hi,

I am writing an application that needs to manipulate dates. More 
precisely, it needs a function that, given a date and a duration (12 
days, 2 weeks, 3 months ...) returns the date at the end of the 
duration. Is there a library providing such a thing ? (I have looked at 
NetDate in ocamlnet, but I cannot find a way to do it that is not a hack 
(convert the date to float, add the number of seconds corresponding to 
the duration (tricky in the case of months), and convert back to date 
format)).

Alan Schmitt

-- 
The hacker: someone who figured things out and made something cool happen.

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Caml-list] date manipulation library
  2003-09-15 14:37 [Caml-list] date manipulation library Alan Schmitt
@ 2003-09-15 14:48 ` Antoine Schweitzer-Chaput
  2003-09-15 15:21 ` Xavier Leroy
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 26+ messages in thread
From: Antoine Schweitzer-Chaput @ 2003-09-15 14:48 UTC (permalink / raw)
  To: caml-list

> (convert the date to float, add the number of seconds corresponding to 
> the duration (tricky in the case of months), and convert back to date 
> format)).

this is not good, because of time savings, bisextiles years, and so
on...
I know this is not a constructive answer, sorry..., but it is a problem
I've had with programs I wrote in others languages. It showed me that
one should not use timestamps but only predefined date constructors,
however I don't know how they work in Caml...

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Caml-list] date manipulation library
  2003-09-15 14:37 [Caml-list] date manipulation library Alan Schmitt
  2003-09-15 14:48 ` Antoine Schweitzer-Chaput
@ 2003-09-15 15:21 ` Xavier Leroy
  2003-09-15 15:40   ` Alan Schmitt
  2003-09-15 16:38   ` David Brown
  2003-09-15 15:22 ` Julien Signoles
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 26+ messages in thread
From: Xavier Leroy @ 2003-09-15 15:21 UTC (permalink / raw)
  To: caml-list, alan.schmitt

> I am writing an application that needs to manipulate dates. More 
> precisely, it needs a function that, given a date and a duration (12 
> days, 2 weeks, 3 months ...) returns the date at the end of the 
> duration. Is there a library providing such a thing ?

Good old Unix.mktime could perhaps do the job.  It has the ability to
correct for impossible dates, e.g. change Sept 32nd into Oct 2nd,
or 2003-13-01 into 2004-01-01.

So, perhaps you could just increment the tm_mday, tm_mon or tm_year of
a "tm" record by the specified amount, then call Unix.mktime and
discard the first result to get a normalized, but equivalent date.

- Xavier Leroy

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Caml-list] date manipulation library
  2003-09-15 14:37 [Caml-list] date manipulation library Alan Schmitt
  2003-09-15 14:48 ` Antoine Schweitzer-Chaput
  2003-09-15 15:21 ` Xavier Leroy
@ 2003-09-15 15:22 ` Julien Signoles
  2003-09-15 18:34   ` Stefano Zacchiroli
  2003-09-15 15:25 ` [Caml-list] date manipulation library Matthieu Sozeau
  2003-09-17  7:57 ` Pierre Weis
  4 siblings, 1 reply; 26+ messages in thread
From: Julien Signoles @ 2003-09-15 15:22 UTC (permalink / raw)
  To: Alan Schmitt; +Cc: caml-list

On Mon, 15 Sep 2003, Alan Schmitt wrote:

> Hi,

Hi,

> I am writing an application that needs to manipulate dates. More
> precisely, it needs a function that, given a date and a duration (12
> days, 2 weeks, 3 months ...) returns the date at the end of the
> duration. Is there a library providing such a thing ?

My calendar library, available at
http://www.lri.fr/~signoles/prog.en.html, allows such a thing. For
example:

# open Date;;
# let today = today ();;
val today : Date.t = <abstr>
# to_string today;;
- : string = "2003-9-15"
# to_string (add today (Period.month 1));;
- : string = "2003-10-15"
# to_string (add today (Period.day 12));;
- : string = "2003-9-27"

Hope this helps,
Julien Signoles.
-- 
mailto:Julien.Signoles@lri.fr ; http://www.lri.fr/~signoles
"In theory, practice and theory are the same,
but in practice they are different" (Larry McVoy)

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Caml-list] date manipulation library
  2003-09-15 14:37 [Caml-list] date manipulation library Alan Schmitt
                   ` (2 preceding siblings ...)
  2003-09-15 15:22 ` Julien Signoles
@ 2003-09-15 15:25 ` Matthieu Sozeau
  2003-09-17  7:57 ` Pierre Weis
  4 siblings, 0 replies; 26+ messages in thread
From: Matthieu Sozeau @ 2003-09-15 15:25 UTC (permalink / raw)
  To: caml-list

On Monday 15 September 2003 16:37, Alan Schmitt wrote:
> Hi,
Hi!

> I am writing an application that needs to manipulate dates. More
> precisely, it needs a function that, given a date and a duration (12
> days, 2 weeks, 3 months ...) returns the date at the end of the
> duration. Is there a library providing such a thing ? (I have looked at
> NetDate in ocamlnet, but I cannot find a way to do it that is not a hack
> (convert the date to float, add the number of seconds corresponding to
> the duration (tricky in the case of months), and convert back to date
> format)).

I'm currently writing an i18n library for OCaml (locales, timezones, dates, 
numbers etc...). It is in early stages of development but date calculations 
are at the top of my TODO list (i'm actually testing week of month, day of 
week (...) inference). Maybe you should look at it ? I'm particularly 
interseted in getting comments and advices from experienced caml developers 
about this code.

freshmeat project page: http://freshmeat.net/projects/ocamli18n/
-- 
Matthieu Sozeau
www: http://mattam.ath.cx

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Caml-list] date manipulation library
  2003-09-15 15:21 ` Xavier Leroy
@ 2003-09-15 15:40   ` Alan Schmitt
  2003-09-15 16:38   ` David Brown
  1 sibling, 0 replies; 26+ messages in thread
From: Alan Schmitt @ 2003-09-15 15:40 UTC (permalink / raw)
  To: Xavier Leroy; +Cc: caml-list

* Xavier Leroy (xavier.leroy@inria.fr) wrote:
> > I am writing an application that needs to manipulate dates. More 
> > precisely, it needs a function that, given a date and a duration (12 
> > days, 2 weeks, 3 months ...) returns the date at the end of the 
> > duration. Is there a library providing such a thing ?
> 
> Good old Unix.mktime could perhaps do the job.  It has the ability to
> correct for impossible dates, e.g. change Sept 32nd into Oct 2nd,
> or 2003-13-01 into 2004-01-01.
> 
> So, perhaps you could just increment the tm_mday, tm_mon or tm_year of
> a "tm" record by the specified amount, then call Unix.mktime and
> discard the first result to get a normalized, but equivalent date.

Wow, this is great. Now I can answer the question that as been troubling 
me for some time: "What is the date one year after Feb 29th, 2000" ;-)

Thanks,

Alan Schmitt

-- 
The hacker: someone who figured things out and made something cool happen.

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Caml-list] date manipulation library
  2003-09-15 15:21 ` Xavier Leroy
  2003-09-15 15:40   ` Alan Schmitt
@ 2003-09-15 16:38   ` David Brown
  1 sibling, 0 replies; 26+ messages in thread
From: David Brown @ 2003-09-15 16:38 UTC (permalink / raw)
  To: Xavier Leroy; +Cc: caml-list, alan.schmitt

On Mon, Sep 15, 2003 at 05:21:35PM +0200, Xavier Leroy wrote:

> Good old Unix.mktime could perhaps do the job.  It has the ability to
> correct for impossible dates, e.g. change Sept 32nd into Oct 2nd,
> or 2003-13-01 into 2004-01-01.

This isn't as much a gripe about ocaml as Unix/Posix.  Why is there a
gmtime function to split time to UTC, but no equivalent for recombining
UTC time back into seconds?

I guess I can pull mktime out of glibc, and hack it to do this, or
perhaps play some tricks with the environment.

Dave

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Caml-list] date manipulation library
  2003-09-15 15:22 ` Julien Signoles
@ 2003-09-15 18:34   ` Stefano Zacchiroli
  2003-09-15 18:45     ` Maxence Guesdon
  2003-09-15 23:27     ` Julien Signoles
  0 siblings, 2 replies; 26+ messages in thread
From: Stefano Zacchiroli @ 2003-09-15 18:34 UTC (permalink / raw)
  To: caml-list

On Mon, Sep 15, 2003 at 05:22:49PM +0200, Julien Signoles wrote:
> My calendar library, available at
> http://www.lri.fr/~signoles/prog.en.html, allows such a thing. For
> example:

Really interesting, thanks for this contribution!
I'm working on schema implementation and this library turns out to be
really handy wrt date/time/periods comparison.

I'm interested in releasing a debian package of it, if it's ok for you.

I've also some comments on the library, I will be happy to know your
position on them:

1) why the timezone setting is global? It's really a non functional
   approach and it turns out to be very annoying.
   I would rather prefer to have an optional timezone attached to both
   time and dates. This could be reflected in an optional parameter of
   date/time constructors and in destructors to fetch timezones raising
   exceptions when it's undefined.

2) often user defined pretty printing is needed for time/dates. What
   about adding more pretty printing functions in addition to the
   already provided to_string? Implementing a generic pretty printing
   format which use the "date" unix command format will be fantastic for
   unix gurus. Just to start a generic destructor function will be
   great.

I'm willing to help working on this changes if you like.

Minor observations:

- the library isn't on the humps, am I wrong?

- there's a wonderful typo (look at the day) :-))))

        (* Return [true] if a date is a leap day
         (i.e. February, 24th of a leap year); [false] otherwise. *)
      val is_leap_day : t -> bool

Thanks for the library, this is the tipical piece of code that thousands
of people keep on reinventing!

Cheers.

P.S. what about ocamldefun? :-)

-- 
Stefano Zacchiroli  --  Master in Computer Science @ Uni. Bologna, Italy
zack@{cs.unibo.it,debian.org,bononia.it}  -  http://www.bononia.it/zack/
"  I know you believe you understood what you think I said, but I am not
sure you realize that what you heard is not what I meant!  " -- G.Romney

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Caml-list] date manipulation library
  2003-09-15 18:34   ` Stefano Zacchiroli
@ 2003-09-15 18:45     ` Maxence Guesdon
  2003-09-15 23:27     ` Julien Signoles
  1 sibling, 0 replies; 26+ messages in thread
From: Maxence Guesdon @ 2003-09-15 18:45 UTC (permalink / raw)
  To: caml-list

Hi,

> - the library isn't on the humps, am I wrong?

No it is not; I will add it ;-)

Regards,

-- 
Maxence Guesdon

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Caml-list] date manipulation library
  2003-09-15 18:34   ` Stefano Zacchiroli
  2003-09-15 18:45     ` Maxence Guesdon
@ 2003-09-15 23:27     ` Julien Signoles
  2003-09-16  7:20       ` Stefano Zacchiroli
  1 sibling, 1 reply; 26+ messages in thread
From: Julien Signoles @ 2003-09-15 23:27 UTC (permalink / raw)
  To: Stefano Zacchiroli; +Cc: caml-list, zack, Julien Signoles

On Mon, 15 Sep 2003, Stefano Zacchiroli wrote:

> I'm interested in releasing a debian package of it, if it's ok for you.

ok for me.

> 1) why the timezone setting is global? It's really a non functional
>    approach and it turns out to be very annoying.
>    I would rather prefer to have an optional timezone attached to both
>    time and dates. This could be reflected in an optional parameter of
>    date/time constructors and in destructors to fetch timezones raising
>    exceptions when it's undefined.

Yes, it is an imperative approach. I think you mostly set the time zone
once at the beginning of your program: you don't change the time zone
while you're computing some values. Sometimes, you may want to convert a
time from a time zone to another one and I produce some converters to do
that. So, my philosophy is:
(1) set the time zone globaly: easier use of times and dates
(an optional parameter is ok... if the default value is as you wish ;).
(2) change the time zone localy if you need (use the converters).

> 2) often user defined pretty printing is needed for time/dates. What
>    about adding more pretty printing functions in addition to the
>    already provided to_string? Implementing a generic pretty printing
>    format which use the "date" unix command format will be fantastic for
>    unix gurus. Just to start a generic destructor function will be
>    great.

Yes, great idea. It is now in my TODO list :).

> - the library isn't on the humps, am I wrong?

You're right (but not my responsibility).

> - there's a wonderful typo (look at the day) :-))))
>
>         (* Return [true] if a date is a leap day
>          (i.e. February, 24th of a leap year); [false] otherwise. *)
>       val is_leap_day : t -> bool

Not a typo !!! :o))) And the implementation of [is_leap_day] follows this
specification.

The justification comes from the calendar FAQ
(http://www.tondering.dk/claus/calendar.html):

==================================
2.3. What day is the leap day?
------------------------------

It is 24 February!

Weird? Yes! The explanation is related to the Roman calendar and is
found in section 2.7.1.

>From a numerical point of view, of course 29 February is the extra
day. But from the point of view of celebration of feast days, the
following correspondence between days in leap years and non-leap
years has traditionally been used:

        Non-leap year           Leap year
        -------------           ----------
        22 February             22 February
        23 February             23 February
                                24 February (extra day)
        24 February             25 February
        25 February             26 February
        26 February             27 February
        27 February             28 February
        28 February             29 February

For example, the feast of St. Leander has been celebrated on 27
February in non-leap years and on 28 February in leap years.
==================================

Cheers,
Julien Signoles
-- 
mailto:Julien.Signoles@lri.fr ; http://www.lri.fr/~signoles
"In theory, practice and theory are the same,
but in practice they are different" (Larry McVoy)

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Caml-list] date manipulation library
  2003-09-15 23:27     ` Julien Signoles
@ 2003-09-16  7:20       ` Stefano Zacchiroli
  2003-09-16  7:32         ` Mattias Waldau
  0 siblings, 1 reply; 26+ messages in thread
From: Stefano Zacchiroli @ 2003-09-16  7:20 UTC (permalink / raw)
  To: caml-list

On Tue, Sep 16, 2003 at 01:27:52AM +0200, Julien Signoles wrote:
> > 1) why the timezone setting is global? It's really a non functional
> >    approach and it turns out to be very annoying.
> >    I would rather prefer to have an optional timezone attached to both
> >    time and dates. This could be reflected in an optional parameter of
> >    date/time constructors and in destructors to fetch timezones raising
> >    exceptions when it's undefined.
> 
> Yes, it is an imperative approach. I think you mostly set the time zone
> once at the beginning of your program: you don't change the time zone
> while you're computing some values. Sometimes, you may want to convert a
> time from a time zone to another one and I produce some converters to do
> that. So, my philosophy is:
> (1) set the time zone globaly: easier use of times and dates
> (an optional parameter is ok... if the default value is as you wish ;).
> (2) change the time zone localy if you need (use the converters).

This approach implicitely assume that most of the time you're dealing
with dates/times which are relativa to a common timezone and that
sparingly you have to convert from a timezone to another. What if most
of the time you're dealing with non-homogeneous timezone date/times?
Many applications have such a requirement.

If you want to keep it imperative at least a functor that permits to
preserve different timezone states would be great. It's still worst than
timezone associated to date/times IMHO.

> The justification comes from the calendar FAQ
> (http://www.tondering.dk/claus/calendar.html):

Sorry, thanks for the link!

Cheers.

-- 
Stefano Zacchiroli  --  Master in Computer Science @ Uni. Bologna, Italy
zack@{cs.unibo.it,debian.org,bononia.it}  -  http://www.bononia.it/zack/
"  I know you believe you understood what you think I said, but I am not
sure you realize that what you heard is not what I meant!  " -- G.Romney

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Caml-list] date manipulation library
  2003-09-16  7:20       ` Stefano Zacchiroli
@ 2003-09-16  7:32         ` Mattias Waldau
  2003-09-16  8:29           ` Benjamin Geer
  0 siblings, 1 reply; 26+ messages in thread
From: Mattias Waldau @ 2003-09-16  7:32 UTC (permalink / raw)
  Cc: caml-list

If you are going to implement a Date-library from scratch, please steal 
the interface. Either you make a ripoff of Microsoft or Java. The 
advantages are obvious:

1. You do not have to document the interface
2. You do not waste time reimplementing the wheel
3. Fewer bugs
4. The library will be complete from start
5. Porting applications to/from Ocaml gets easier

The source for Java's implementation can be found at

http://korea.gnu.org/gcc/src/gcc-3.1/libjava/java/util/Date.java

-- Mattias


-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Caml-list] date manipulation library
  2003-09-16  7:32         ` Mattias Waldau
@ 2003-09-16  8:29           ` Benjamin Geer
  2003-09-16 18:21             ` [Caml-list] Will Emacs camldebug-mode need an update for 3.07? Mattias Waldau
  0 siblings, 1 reply; 26+ messages in thread
From: Benjamin Geer @ 2003-09-16  8:29 UTC (permalink / raw)
  To: Mattias Waldau; +Cc: caml-list

Mattias Waldau wrote:
 > The source for Java's implementation can be found at
 >
 > http://korea.gnu.org/gcc/src/gcc-3.1/libjava/java/util/Date.java

I wouldn't recommend copying the Java interface verbatim.  The 
java.util.Date class was designed (in JDK 1.0) without regard for 
localisation.  In JDK 1.1, the java.util.Calendar class was added to fix 
this problem.  The combination of Date and Calendar works well in Java; 
Date is fine for most purposes, and when you want calendar 
functionality, you use the more heavyweight Calendar object.  But as you 
can see from the source code of Date, all its calendar functionality in 
java.util.Date is deprecated.  If you wanted to write something like 
this from scratch, you probably wouldn't want to include any calendar 
functionality in Date at all.

Ben

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Caml-list] Will Emacs camldebug-mode need an update for 3.07?
  2003-09-16  8:29           ` Benjamin Geer
@ 2003-09-16 18:21             ` Mattias Waldau
  0 siblings, 0 replies; 26+ messages in thread
From: Mattias Waldau @ 2003-09-16 18:21 UTC (permalink / raw)
  To: caml-list

If you use both cygwin and linux, camldebug under emacs very often 
places the cursor at the wrong position. This is probably due to that it 
uses char-position from start of file and the fact that line ends can 
either be LF or CRLF.

In 3.07 line position is available, however it doesn't seem that 
camldebug.el uses them. I still get the cursor at the wrong position.

Is this right? camldebug.el seems unchanged in 3.07.

If needed, I can try to fix camldebug.el. Ideas on how to do this are 
appreciated.

-- Mattias



-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Caml-list] date manipulation library
  2003-09-15 14:37 [Caml-list] date manipulation library Alan Schmitt
                   ` (3 preceding siblings ...)
  2003-09-15 15:25 ` [Caml-list] date manipulation library Matthieu Sozeau
@ 2003-09-17  7:57 ` Pierre Weis
  2003-09-17  8:24   ` Mattias Waldau
  2003-09-17  9:19   ` [Caml-list] date manipulation library Stefano Zacchiroli
  4 siblings, 2 replies; 26+ messages in thread
From: Pierre Weis @ 2003-09-17  7:57 UTC (permalink / raw)
  To: Alan Schmitt; +Cc: caml-list

Hi Alan,

> I am writing an application that needs to manipulate dates. More 
> precisely, it needs a function that, given a date and a duration (12 
> days, 2 weeks, 3 months ...) returns the date at the end of the 
> duration. Is there a library providing such a thing ? (I have looked at 
> NetDate in ocamlnet, but I cannot find a way to do it that is not a hack 
> (convert the date to float, add the number of seconds corresponding to 
> the duration (tricky in the case of months), and convert back to date 
> format)).
> 
> Alan Schmitt
> 
> -- 
> The hacker: someone who figured things out and made something cool happen.
> 
> -------------------
> To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
> Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners

As part of the bazar-ocaml, the ``htmlc'' template files compiler for
HTML is distributed for years now.
As part of htmlc, a complete (i.e. fairly rich) date manipulation
library is distributed.
It has been used for years in various contexts, is properly
documented, and has no known bugs.

If this library approximately satisfies your needs, let me know if
something is missing, or if you want to add more functionalities: we
can share the development!

To give you an idea, here is the interface for the (auxilliary) date module:

-------------------------------------------------------------------------
(* Getting the time of day. *)

val local_date_of_day : Lang.t -> string;;
 (* Return the current date as a string according to the [lang] argument.
    Assumes the local time zone. *)

val date_of_day : Lang.t -> string;;
 (* Return the current date as a string according to the [lang] argument.
    Assumes Greenwich meridian time zone, also known as UTC. *)

val date_uk_of_day : unit -> string;;
val date_fr_of_day : unit -> string;;
 (* The string representation of the current time of day, respectively
    in english and french. Assumes the local time zone. *)

val date : unit -> string;;
 (* Synomym for [date_of_day Uk]. *)

val local_date : unit -> string;;
 (* Synomym for [local_date_of_day Uk]. *)

val time_of_day : unit -> tm;;
 (* Return the time of day as a Unix time. Assumes Greenwich meridian
    time zone, also known as UTC. *)

val string_of_time : Lang.t -> tm -> string;;
 (* Translate a Unix time to a string according to the [lang]
    argument. *)

 (* Last modification time of a file. *)
val last_modification_time_of_file : string -> tm;;
val last_modification_date_of_file : Lang.t -> string -> string;;
 (* Assumes Greenwich meridian time zone. *)
-------------------------------------------------------------------------

And now, the interface file for lib_date library:

-------------------------------------------------------------------------
val year_is_leap : int -> bool;;
 (* Checks if the int argument represents a leap year. *)
val last_day_of_month : int -> int -> int;;
 (* [last_day_of_month month year] returns the number of the last day
    of the month for the given year. *)
val date_is_valid : int -> int -> int -> bool;;
 (* [date_is_valid month_day month year] checks if the given arguments
    represent a valid date. *)
val compare_date : (int * int * int) -> (int * int * int) -> int;;
 (* Compares two dates represented as triple of integers [(month_day,
    month, year)], with the same convention as the polymorphic
    comparison [compare]. [compare_date (d1, m1, y1) (d2, m2, y2)]
    returns respectively [0], [1], or [-1], if date [(d1, m1, y1)] is
    respectively equal to, greater than, or lower than
    the date [(d2, m2, y2)]. *)
val week_day_of_date : int -> int -> int -> int;;
 (* [week_day_of_date month_day month year] return the number of the
    day in the week that corresponds to the date
    [month_day, month, year].
    (Week days are numbered from [0] for sunday to [6] for saturday.) *)

(* Translation from integer representation to day and month names. *)

val string_of_month : Lang.t -> int -> string;;
val string_of_week_day : Lang.t -> int -> string;;
 (* Mapping from days and months, represented as theirs numbers, to
    their usual character string names.
    The numbering starts from 0: thus Sunday and January have number 0.
    These functions raise [Invalid_argument] if their arguments are out of
    the proper range ([0..6] for day numbers and [0..11] for month
    numbers), or if the language is not supported. *)
val string_of_date : Lang.t ->
    int -> int -> int ->
    string * string * string * string;;
 (* [string_of_date lang d m y] calculates the week day associated
    with the date [d, m, y], and returns the string representations of
    the tuple [(week_day, d, m, y)].
    For instance [string_of_date Uk (21, 3, 2000)] is
    [("Tuesday", "21", "March", "2000")]. *)

val string_of_full_date : Lang.t ->
    int -> int -> int -> int ->
    string * string * string * string;;
 (* [string_of_full_date lang w d m y] returns a string representation
    of the tuple [(w, d, m, y)], supposed to be a date [d, m, y] with
    week day [w]. *)

val string_of_mois : int -> string;;
val string_of_jour : int -> string;;
 (* Same as above for french days and months. *)

val week_day_of_string : Lang.t -> string -> int;;
val month_of_string : Lang.t -> string -> int;;
 (* Map a day  (resp. a month) represented as a string for the language
    [lang] to the corresponding number. Recognition of valid strings is
    case unsensitive and usual abbreviations are accepted.
    Raise [Invalid_argument "unknown language"], if the language is
    not supported. *)

val format_date : Lang.t -> int -> int -> int -> int -> string;;
 (* [format_date lang month_day month week_day year] returns a string
    representation of a date according to the language [lang]. The
    date is represented by 4 integers: [week_day] and
    [month] are the numbers encoding the names of the day and
    the name of the month. Their should be in a range suitable for calling
    [string_of_month] and [string_of_week_day].
    The [month_day] and [year] arguments are the number of the day in
    the month and the number of the year. If the year number is lesser
    than 1000, then 1900 is added to it.
    There is no verification that the date is valid.
    For instance,
    [format_date Uk 31 12 5 00] is ["Friday, December 31, 1900"],
    [format_date Uk 31 12 5 101] is ["Friday, December 31, 2001"],
    [format_date Uk 31 12 5 2000] is ["Friday, December 31, 2000"]. *)
val string_of_Uk_date : int -> int -> int -> int -> string;;
val string_of_Fr_date : int -> int -> int -> int -> string;;
 (* Same as above for french or english translations. *)

val parse_date : Lang.t -> string -> int * int * int * int;;
 (* [parse_date lang s] parse the string [s] according to the language
 [lang], and return a date, the validity of which is not verified.
 Separators between words in [s] can be any of [' '], ['\t'], ['/'], [','],
 ['-'], or ['.'] and can be repeated.
 - If only one word is found in [s], this word is supposed to be made of
 digits that encode the date. Eight digits means [ddmmyyyy] (as
 [01032000] to mean first of March 2000), six digits means [ddmmyy]
 (as [010300] to mean first of March 1900), less than six digits means
 [yy] or [yyyy] (only the year number is provided, day and month
 default to first of January).
 - If two words are found, they are supposed to be the month and the year
 in that order, and the resulting date defaults to the first day of the
 given month and year.
 - If three words are found, they are supposed to be the month day, the
 month and the year. Order is language dependant, and follows the
 conventions of [format_date].
 - If four words are found, they are supposed to be the week day, the
 month day, the month and the year. Order is language dependant, and
 follows the conventions of [format_date].

 Note: if necessary the week day of the date may be found using the
 function [week_day_of_date]. *)

val parse : string -> int * int * int * int;;
 (* [parse s] is equivalent to [parse_date Uk s]. *)
val format : int -> int -> int -> int -> string;;
 (* [format month_day month week_day year] is equivalent to
    [format_date Uk month_day month week_day year]. *)

val valid_date : Lang.t -> string -> int * int * int * int;;
 (* [valid_date lang s] parse the string [s] according to the
 language [lang] and return a valid date or raises [invalid_arg]. *)

val normalize_date : Lang.t -> string -> string * string * string * string;;
----------------------------------------------------------------------------

Hope this helps,

Pierre Weis

INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://pauillac.inria.fr/~weis/

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Caml-list] date manipulation library
  2003-09-17  7:57 ` Pierre Weis
@ 2003-09-17  8:24   ` Mattias Waldau
  2003-09-17 15:17     ` Pierre Weis
  2003-09-17  9:19   ` [Caml-list] date manipulation library Stefano Zacchiroli
  1 sibling, 1 reply; 26+ messages in thread
From: Mattias Waldau @ 2003-09-17  8:24 UTC (permalink / raw)
  To: Pierre Weis; +Cc: caml-list

Hi Pierre,

I quickly looked at the license of htmlc, and it seems that it cannot be 
used inside commercial applications. Right?

If I am right, can this be changed to BSD (preferred) or LGPL?

The licensing of Ocaml libraries is becoming a problem for commercial 
program developers like myself. Maybe we should add a column to the HUMP 
and similar with a checkmark for libraries that can be used in 
commercial non-open-source applications.

-- Mattias



-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Caml-list] date manipulation library
  2003-09-17  7:57 ` Pierre Weis
  2003-09-17  8:24   ` Mattias Waldau
@ 2003-09-17  9:19   ` Stefano Zacchiroli
  2003-09-17 15:28     ` Pierre Weis
  1 sibling, 1 reply; 26+ messages in thread
From: Stefano Zacchiroli @ 2003-09-17  9:19 UTC (permalink / raw)
  To: caml-list

On Wed, Sep 17, 2003 at 09:57:16AM +0200, Pierre Weis wrote:
> To give you an idea, here is the interface for the (auxilliary) date
> module:

What about timezones?

It seems from the interface you posted that there's no convertion
functions between them.

Cheers.

-- 
Stefano Zacchiroli  --  Master in Computer Science @ Uni. Bologna, Italy
zack@{cs.unibo.it,debian.org,bononia.it}  -  http://www.bononia.it/zack/
"  I know you believe you understood what you think I said, but I am not
sure you realize that what you heard is not what I meant!  " -- G.Romney

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Caml-list] date manipulation library
  2003-09-17  8:24   ` Mattias Waldau
@ 2003-09-17 15:17     ` Pierre Weis
  2003-09-19 14:48       ` [Caml-list] A plea for clear licenses (Was: date manipulation library) Florian Hars
  0 siblings, 1 reply; 26+ messages in thread
From: Pierre Weis @ 2003-09-17 15:17 UTC (permalink / raw)
  To: Mattias Waldau; +Cc: pierre.weis, caml-list

Hi Mattias,

> I quickly looked at the license of htmlc, and it seems that it cannot be 
> used inside commercial applications. Right?

Wrong.

> If I am right, can this be changed to BSD (preferred) or LGPL?

Is it necessary then ?

> The licensing of Ocaml libraries is becoming a problem for commercial 
> program developers like myself. Maybe we should add a column to the HUMP 
> and similar with a checkmark for libraries that can be used in 
> commercial non-open-source applications.

And check htmlc since it can be used for every thing you like: you
just have to distribute the original source files of the library and
the LICENSE file.

Is it too much to ask for ?

Pierre


-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Caml-list] date manipulation library
  2003-09-17  9:19   ` [Caml-list] date manipulation library Stefano Zacchiroli
@ 2003-09-17 15:28     ` Pierre Weis
  0 siblings, 0 replies; 26+ messages in thread
From: Pierre Weis @ 2003-09-17 15:28 UTC (permalink / raw)
  To: Stefano Zacchiroli; +Cc: caml-list

> On Wed, Sep 17, 2003 at 09:57:16AM +0200, Pierre Weis wrote:
> > To give you an idea, here is the interface for the (auxilliary) date
> > module:
> 
> What about timezones?
> 
> It seems from the interface you posted that there's no convertion
> functions between them.

Right, there are two functions to get the date in UTC or local
time zone:

val local_date_of_day : Lang.t -> string;;
 (* Return the current date as a string according to the [lang] argument.
    Assumes the local time zone. *)

val date_of_day : Lang.t -> string;;
 (* Return the current date as a string according to the [lang] argument.
    Assumes Greenwich meridian time zone, also known as UTC. *)

A time_zone type definition with a convertion function would be a
useful addition (to gether with date zone handling).

Cheers,

Pierre Weis

INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://pauillac.inria.fr/~weis/


-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Caml-list] A plea for clear licenses (Was: date manipulation library)
  2003-09-17 15:17     ` Pierre Weis
@ 2003-09-19 14:48       ` Florian Hars
  2003-09-20 14:22         ` [Caml-list] " Pierre Weis
  2003-09-20 18:42         ` [Caml-list] " skaller
  0 siblings, 2 replies; 26+ messages in thread
From: Florian Hars @ 2003-09-19 14:48 UTC (permalink / raw)
  To: Pierre Weis; +Cc: caml-list

            "Do not write a new license if it is possible to use one of
             the ones listed here."
            (http://www.oreilly.com/catalog/opensources/book/perens.html)

Pierre Weis wrote:
> And check htmlc since it can be used for every thing you like: you
> just have to distribute the original source files of the library and
> the LICENSE file.

What you say isn't what the license says. It says (if you get past the 
infinite recursion between point a- and b-, that is) that you can either 
distribute:

- the original, unaltered source
- a compiled version of the original, unaltered source
- a derived work in the form of the original, unaltered source together
   with a patch against this original, unaltered source, for the receiver
   to compile. ("consists of" is stronger than "contains").

It doesn't allow you to distribute compiled versions of derived works 
like, for example, a program that uses the date manipulation library 
included with htmlc.

Maybe the intention was different, but the wording is so terribly 
unclear that nothing more can be deduced from this document.

See also point 5 of http://people.debian.org/~bap/dfsg-faq.html on how 
to choose a free license.

As far as I can see, there are three viable, essentially different 
license choices for ocaml library code:

1. Plain GPL, if you want to make the library and all derivatives free
    in the GNU sense.

2. LGPL plus linking exception, if you want to keep the library free,
    but want to allow commercial use. This is the license of the ocaml
    standard library, and using it as a default makes it easier to
    combine different libraries in a project. You should only use another
    license if you really know why you do it (for example, to achieve the
    effects of point 1 and 3).

    Note that because of the way the ocaml linker works the plain LGPL
    may or may not be equivalent to the plain GPL for ocaml code. Some
    lawyers (those of IBM, for example) think that you should always
    distribute code that uses LGPL code under 6b) of the LGPL and link
    the code dynamically to steer clear of possible problems. But this is
    not possible with ocaml. And re-linking a compiled object with a
    modified version of a library can result in the linker complaining
    about inconsistent interface assumptions for all but the most trivial
    changes, which makes it very difficult to distribute a compiled
    program in accordance with 6a) of the LGPL, which leaves you with
    distribution of the source as the only option.
    (Of course you can refactor your aplication into a functor and
    distribute a source file that instatiates this functor with the LGPL
    library, but this is not necessarily what I would call 'elegant'.)

3. BSD/X11-style, if you want to make your library free in the BSD
    sense.

Using anything else will just add to the confusion, splinter the 
language community, turn the grass yellow and make your hair fall out.

Yours, Florian Hars.

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Caml-list] Re: A plea for clear licenses (Was: date manipulation library)
  2003-09-19 14:48       ` [Caml-list] A plea for clear licenses (Was: date manipulation library) Florian Hars
@ 2003-09-20 14:22         ` Pierre Weis
  2003-09-20 18:42         ` [Caml-list] " skaller
  1 sibling, 0 replies; 26+ messages in thread
From: Pierre Weis @ 2003-09-20 14:22 UTC (permalink / raw)
  To: Florian Hars; +Cc: pierre.weis, caml-list

> What you say isn't what the license says. It says (if you get past the 
> infinite recursion between point a- and b-, that is) that you can either 
> distribute:
> 
> - the original, unaltered source
> - a compiled version of the original, unaltered source
> - a derived work in the form of the original, unaltered source together
>    with a patch against this original, unaltered source, for the receiver
>    to compile. ("consists of" is stronger than "contains").
> 
> It doesn't allow you to distribute compiled versions of derived works 
> like, for example, a program that uses the date manipulation library 
> included with htmlc.
> 
> Maybe the intention was different, but the wording is so terribly 
> unclear that nothing more can be deduced from this document.

Htmlc licence changed recently; it words like that:

  Source distribution of derivative works obtained by modifying the
  software or integrating it in another software is allowed, only if the
  distribution consists of the unmodified, original source files for the
  software, along with difference files (patches) to be applied by the
  user of the derivative work.

  Binary distribution of derivative works obtained by modifying the
  software or integrating it in another software is allowed, only if the
  distribution explicitely contains the following sentance

  ``Htmlc code is used into this software; htmlc is copyrighted INRIA
    and can be downloaded from http://caml.inria.fr/htmlc/.''

  Typical place for this phrase being the About-dialog and the
  documentation of the derivative work.

This seems now reasonably clear, no ?

> See also point 5 of http://people.debian.org/~bap/dfsg-faq.html on how 
> to choose a free license.

[...]

> Using anything else will just add to the confusion, splinter the 
> language community, turn the grass yellow and make your hair fall out.

Sorry, but I cannot agree with you, at least concerning the INRIA Caml
developers team. These people are not hobbyists nor students. They are
not developping in their garage and/or on sourceforge. It turns out
that they are paid full time by the french government, and this gives
them a lot of rights and some correlative duties. Believe it or not,
France has been editing laws about workers and civil servants for a
long time from now. One of this law explicitly states that the
software written by employees during their working hours is the
property of their employer (being it public or private). Consider all
the implications of this fact and in particular what it means when we
are at picking up a licence for a software we want to distribute: we
have to be extremely cautious in choosing a licence that INRIA's head
quarters can consider acceptable...

None of the licences you mentioned has been reviewed by INRIA lawyers
for adequacy to the french laws. Htmlc's licence, while exotic from
your point of view, has been used for years here: I think it is safer
from our point of view of INRIA's workers.

Yours,

Pierre Weis

INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://pauillac.inria.fr/~weis/


-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Caml-list] A plea for clear licenses (Was: date manipulation library)
  2003-09-19 14:48       ` [Caml-list] A plea for clear licenses (Was: date manipulation library) Florian Hars
  2003-09-20 14:22         ` [Caml-list] " Pierre Weis
@ 2003-09-20 18:42         ` skaller
  2003-09-21 16:33           ` Richard Jones
  2003-09-23  6:28           ` [Caml-list] A plea for clear licenses Florian Hars
  1 sibling, 2 replies; 26+ messages in thread
From: skaller @ 2003-09-20 18:42 UTC (permalink / raw)
  To: Florian Hars; +Cc: Pierre Weis, caml-list

On Sat, 2003-09-20 at 00:48, Florian Hars wrote:

> 3. BSD/X11-style, if you want to make your library free in the BSD
>     sense.
> 
> Using anything else will just add to the confusion, splinter the 
> language community, turn the grass yellow and make your hair fall out.

What's wrong with plain old 'public domain'?


-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Caml-list] A plea for clear licenses (Was: date manipulation library)
  2003-09-20 18:42         ` [Caml-list] " skaller
@ 2003-09-21 16:33           ` Richard Jones
  2003-09-23  6:28           ` [Caml-list] A plea for clear licenses Florian Hars
  1 sibling, 0 replies; 26+ messages in thread
From: Richard Jones @ 2003-09-21 16:33 UTC (permalink / raw)
  To: skaller; +Cc: Florian Hars, Pierre Weis, caml-list

On Sun, Sep 21, 2003 at 04:42:54AM +1000, skaller wrote:
> On Sat, 2003-09-20 at 00:48, Florian Hars wrote:
> 
> > 3. BSD/X11-style, if you want to make your library free in the BSD
> >     sense.
> > 
> > Using anything else will just add to the confusion, splinter the 
> > language community, turn the grass yellow and make your hair fall out.
> 
> What's wrong with plain old 'public domain'?

It's not clear that people can voluntarily put even their own work
into the public domain, although obviously some people say they do
this.

Rich.

-- 
Richard Jones. http://www.annexia.org/ http://freshmeat.net/users/rwmj
Merjis Ltd. http://www.merjis.com/ - all your business data are belong to you.
"One serious obstacle to the adoption of good programming languages is
the notion that everything has to be sacrificed for speed. In computer
languages as in life, speed kills." -- Mike Vanier

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Caml-list] A plea for clear licenses
  2003-09-20 18:42         ` [Caml-list] " skaller
  2003-09-21 16:33           ` Richard Jones
@ 2003-09-23  6:28           ` Florian Hars
  2003-09-23 23:17             ` Rafael 'Dido' Sevilla
  1 sibling, 1 reply; 26+ messages in thread
From: Florian Hars @ 2003-09-23  6:28 UTC (permalink / raw)
  To: skaller; +Cc: caml-list

skaller wrote:
> On Sat, 2003-09-20 at 00:48, Florian Hars wrote:
>>Using anything else will just add to the confusion
> What's wrong with plain old 'public domain'?

In many parts of the world, including most of europe where many ocaml 
users live, about the only way for an author to release something he has 
written into the public domain is to have died seventy years ago. This 
may cause a significant slowdown of the development of a library.

Yours,  Florian.

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Caml-list] A plea for clear licenses
  2003-09-23  6:28           ` [Caml-list] A plea for clear licenses Florian Hars
@ 2003-09-23 23:17             ` Rafael 'Dido' Sevilla
  2003-09-23 23:29               ` Michael Beach
  0 siblings, 1 reply; 26+ messages in thread
From: Rafael 'Dido' Sevilla @ 2003-09-23 23:17 UTC (permalink / raw)
  To: caml-list

On Tue, Sep 23, 2003 at 08:28:41AM +0200, Florian Hars wrote:
> skaller wrote:
> >On Sat, 2003-09-20 at 00:48, Florian Hars wrote:
> >>Using anything else will just add to the confusion
> >What's wrong with plain old 'public domain'?
> 
> In many parts of the world, including most of europe where many ocaml 
> users live, about the only way for an author to release something he has 
> written into the public domain is to have died seventy years ago. This 
> may cause a significant slowdown of the development of a library.
> 

Really?  An author may not *voluntarily* release his or her own work into
the public domain?  I don't see how that may be so.  It is certainly not
true under US copyright law, nor is it the doctrine of the Berne
Convention.  I was under the impression that possession of the copyright
to a particular work implies you also have the full and unlimited power
to license your work as you see fit.

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [Caml-list] A plea for clear licenses
  2003-09-23 23:17             ` Rafael 'Dido' Sevilla
@ 2003-09-23 23:29               ` Michael Beach
  0 siblings, 0 replies; 26+ messages in thread
From: Michael Beach @ 2003-09-23 23:29 UTC (permalink / raw)
  To: Rafael 'Dido' Sevilla, caml-list

On Wed, 24 Sep 2003 09:17 am, Rafael 'Dido' Sevilla wrote:
> On Tue, Sep 23, 2003 at 08:28:41AM +0200, Florian Hars wrote:
> > skaller wrote:
> > >On Sat, 2003-09-20 at 00:48, Florian Hars wrote:
> > >>Using anything else will just add to the confusion
> > >
> > >What's wrong with plain old 'public domain'?
> >
> > In many parts of the world, including most of europe where many ocaml
> > users live, about the only way for an author to release something he has
> > written into the public domain is to have died seventy years ago. This
> > may cause a significant slowdown of the development of a library.
>
> Really?  An author may not *voluntarily* release his or her own work into

Yes really. I've seen exactly the same issue come up on other mailing lists. 
An example of such a jurisdiction (so I am told) is Germany.

> the public domain?  I don't see how that may be so.  It is certainly not
> true under US copyright law, nor is it the doctrine of the Berne
> Convention.  I was under the impression that possession of the copyright
> to a particular work implies you also have the full and unlimited power
> to license your work as you see fit.
>
> -------------------
> To unsubscribe, mail caml-list-request@inria.fr Archives:
> http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ:
> http://caml.inria.fr/FAQ/ Beginner's list:
> http://groups.yahoo.com/group/ocaml_beginners

Regards
M.Beach

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2003-09-23 23:55 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-15 14:37 [Caml-list] date manipulation library Alan Schmitt
2003-09-15 14:48 ` Antoine Schweitzer-Chaput
2003-09-15 15:21 ` Xavier Leroy
2003-09-15 15:40   ` Alan Schmitt
2003-09-15 16:38   ` David Brown
2003-09-15 15:22 ` Julien Signoles
2003-09-15 18:34   ` Stefano Zacchiroli
2003-09-15 18:45     ` Maxence Guesdon
2003-09-15 23:27     ` Julien Signoles
2003-09-16  7:20       ` Stefano Zacchiroli
2003-09-16  7:32         ` Mattias Waldau
2003-09-16  8:29           ` Benjamin Geer
2003-09-16 18:21             ` [Caml-list] Will Emacs camldebug-mode need an update for 3.07? Mattias Waldau
2003-09-15 15:25 ` [Caml-list] date manipulation library Matthieu Sozeau
2003-09-17  7:57 ` Pierre Weis
2003-09-17  8:24   ` Mattias Waldau
2003-09-17 15:17     ` Pierre Weis
2003-09-19 14:48       ` [Caml-list] A plea for clear licenses (Was: date manipulation library) Florian Hars
2003-09-20 14:22         ` [Caml-list] " Pierre Weis
2003-09-20 18:42         ` [Caml-list] " skaller
2003-09-21 16:33           ` Richard Jones
2003-09-23  6:28           ` [Caml-list] A plea for clear licenses Florian Hars
2003-09-23 23:17             ` Rafael 'Dido' Sevilla
2003-09-23 23:29               ` Michael Beach
2003-09-17  9:19   ` [Caml-list] date manipulation library Stefano Zacchiroli
2003-09-17 15:28     ` Pierre Weis

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).