Version française
Home     About     Download     Resources     Contact us    
Browse thread
Ocaml secrets
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Norman Ramsey <nr@e...>
Subject: Ocaml secrets
I've been going nuts copying record-type definitions, and then Benjamin Pierce
showed me a trick.

Please tell me where in the OCaml manual I could have discovered
the ability to write

  tm.Unix.tm_hour

as in

        let tm = Unix.localtime (Unix.time()) in
        sprintf "%02d:%02d:%02d " tm.Unix.tm_hour tm.Unix.tm_min tm.Unix.tm_sec


Norman

P.S.  just writing let tm = ... in ... tm.tm_hour ... etc causes ocamlc to barf.