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 XAA07332; Wed, 24 Mar 2004 23:34:19 +0100 (MET) 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 XAA03572 for ; Wed, 24 Mar 2004 23:34:18 +0100 (MET) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from web41207.mail.yahoo.com (web41207.mail.yahoo.com [66.218.93.40]) by concorde.inria.fr (8.12.10/8.12.10) with SMTP id i2OMYGHd028870 for ; Wed, 24 Mar 2004 23:34:17 +0100 Message-ID: <20040324223416.40978.qmail@web41207.mail.yahoo.com> Received: from [67.242.203.6] by web41207.mail.yahoo.com via HTTP; Wed, 24 Mar 2004 14:34:16 PST Date: Wed, 24 Mar 2004 14:34:16 -0800 (PST) From: Vasili Galchin Subject: [Caml-list] OReilly exercise question To: caml-list@inria.fr MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Miltered: at concorde by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; wire:99 printf:01 eprintf:01 stdout:01 ocamlc:01 center:98 blah:01 int:01 int:01 flush:01 flush:01 unix:02 unix:02 unbound:02 string:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk X-Status: X-Keywords: X-UID: 353 Hello I am working some of the exercises in the online OReilly book, in particular the time server in the Distributed Computing chapter. I wrote the following function: (* Get time of day and send across the wire *) let time_service ic oc = try let ts = Unix.time () in let (date:Unix.tm) = Unix.gmtime ts in let year = string_of_int (date.tm_year); month = string_of_int (date.tm_mon + 1); day = string_of_int (date.tm_mday); hour = string_of_int (date.tm_hour); minute = string_of_int (date.tm_min); seconds = string_of_int (date.tm_sec) in let r = year^month^day^hour^minute^seconds in output_string oc (r^"\n"); flush oc with _ -> Printf.eprintf "BLAH\n"; flush stdout; xit 0;; I get the following error from ocamlc: File "time1.ml", line 23, characters 30-44: Unbound record field label tm_year I am confused because this field is in Unix.tm! ??? Regards, Vasili __________________________________ Do you Yahoo!? Yahoo! Finance Tax Center - File online. File on time. http://taxes.yahoo.com/filing.html ------------------- 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