caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: romildo@uber.com.br
To: Keith Wansbrough <Keith.Wansbrough@cl.cam.ac.uk>
Cc: romildo@uber.com.br, caml-list@inria.fr
Subject: Re: [Caml-list] Simple clock
Date: Tue, 14 Dec 2004 18:43:47 -0200	[thread overview]
Message-ID: <20041214204347.GB26559@gentoo.malaquias.no-ip.org> (raw)
In-Reply-To: <E1CeGdP-0004qA-00@mta1.cl.cam.ac.uk>

[-- Attachment #1: Type: text/plain, Size: 565 bytes --]

On Tue, Dec 14, 2004 at 05:38:50PM +0000, Keith Wansbrough wrote:
> > 
> > $ simpleclock
> > 15:15:58
> > 15:15:59
> > 15:16:00
> > 15:16:01
> > 
> > I want to receive sugestions on how to implement
> > this.
> 
> Thread.delay
> Unix.time
> Unix.localtime

I have tried the following program, but its
compilation fails with the message:

$ ocamlopt -thread threads.cmxa unix.cmxa simple-clock.ml -o simple-clock
No implementations provided for the following modules:
  Unix referenced from /usr/lib/ocaml/threads/threads.cmxa(Thread)

What does that mean?

Romildo

[-- Attachment #2: simple-clock.ml --]
[-- Type: text/plain, Size: 512 bytes --]

(* simple-clock.ml
   Repeatedly prints the current time at the standard output,
   at intervals of 1 sec

   How to compile:

   ocamlopt -thread threads.cmxa unix.cmxa simple-clock.ml -o simple-clock
*)

open Unix
open Thread

let print_tm tm =
  print_int tm.tm_hour;
  print_char ':';
  print_int tm.tm_min;
  print_char ':';
  print_int tm.tm_sec

let simple_clock () =
  while true do
    print_tm (Unix.localtime (Unix.time ()));
    print_newline ();
    Thread.delay 1.0
  done

let _ = simple_clock ()

  parent reply	other threads:[~2004-12-14 20:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-14 17:17 romildo
2004-12-14 17:38 ` [Caml-list] " Keith Wansbrough
2004-12-14 18:17   ` Lars Nilsson
2004-12-14 20:39     ` romildo
2004-12-14 21:52       ` Ville-Pertti Keinonen
2004-12-15  3:20       ` Kurt Welgehausen
2004-12-15 17:37         ` Evan Martin
2004-12-14 20:43   ` romildo [this message]
2004-12-15  3:00     ` skaller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041214204347.GB26559@gentoo.malaquias.no-ip.org \
    --to=romildo@uber.com.br \
    --cc=Keith.Wansbrough@cl.cam.ac.uk \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).