From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA08453; Tue, 16 Sep 2003 09:20:19 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id JAA05386 for ; Tue, 16 Sep 2003 09:20:18 +0200 (MET DST) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from vsmtp4.tin.it (vsmtp4.tin.it [212.216.176.224]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h8G7KHf13407 for ; Tue, 16 Sep 2003 09:20:17 +0200 (MET DST) Received: from dalamar.takhisis.org (80.117.63.206) by vsmtp4.tin.it (7.0.019) id 3F5D91F000312F4E for caml-list@inria.fr; Tue, 16 Sep 2003 09:20:17 +0200 Received: from fistandantilus.takhisis.org (fistandantilus.takhisis.org [192.168.1.113]) by dalamar.takhisis.org (Postfix) with ESMTP id 78506B79C for ; Tue, 16 Sep 2003 09:20:16 +0200 (CEST) Received: by fistandantilus.takhisis.org (Postfix, from userid 3148) id 5ED71274039; Tue, 16 Sep 2003 09:20:16 +0200 (CEST) Date: Tue, 16 Sep 2003 09:20:16 +0200 From: Stefano Zacchiroli To: caml-list@inria.fr Subject: Re: [Caml-list] date manipulation library Message-ID: <20030916072016.GB9403@fistandantilus.takhisis.org> Mail-Followup-To: caml-list@inria.fr References: <20030915143708.GK2354@alan-schm1p> <20030915183458.GA6577@fistandantilus.takhisis.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i X-Loop: caml-list@inria.fr X-Spam: no; 0.00; bononia:01 caml-list:01 signoles:01 sparingly:01 functor:01 faq:01 bononia:01 imho:01 0200,:01 sep:01 constructors:01 philosophy:02 bologna:03 wrote:03 annoying:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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