Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] OReilly exercise question
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Vasili Galchin <vasiliocaml@y...>
Subject: [Caml-list] OReilly exercise question

    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

(* Get time of day and send across the wire *)
let time_service ic oc =
     let ts = Unix.time () in
     let ( = 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 "", line 23, characters 30-44:
Unbound record field label tm_year

I am confused because this field is in! ???

Regards, Vasili

Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: