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
Sorted list
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-08-04 (15:17)
From: tmp123@m...
Subject: Re: [Caml-list] Sorted list
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<body bgcolor="#ffffff" text="#000000">
skaller wrote:
<blockquote cite="mid1186226538.14440.105.camel@rosella.wigram"
  <pre wrap="">On Sat, 2007-08-04 at 12:29 +0200, Philippe Wang wrote:
  <blockquote type="cite">
    <pre wrap=""><a class="moz-txt-link-abbreviated"
 href=""></a> wrote:
  <pre wrap=""><!---->
  <blockquote type="cite">
    <blockquote type="cite">
      <pre wrap="">Of the standard modules, the most similar seems "set", because allows 
insertion and has the funcion "min_elt". However, the problem is, if 
two timers have the same time, addition of the second one removes the 

Please, has someone any sugestion?

Thanks a lot.
  <pre wrap="">
You must keep a list of functions to fire off at a given time,
so the map will be

	time -&gt; timerid list

and you'll also need timerid -&gt; time * (unit-&gt;unit) to fetch the
function from the id.

Thanks for the sugestion.<br>
It seems dificult to generate an unique identifier, for this subject or
any other (in this sense, I feel nostalgic of the old C pointers). <br>
An integer counter could be valid, but, when the counter reaches the
maximum, the counter needs to return to "0". From now on, before to
return a new identifier, it should be checked if this value is already
in use. And that means O(n).<br>
I do not see solution for that.<br>
Kind regards.<br>