Browse thread
Sorted list
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: | 2007-08-04 (14:37) |
From: | tmp123@m... |
Subject: | Re: [Caml-list] Sorted list |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> <title></title> </head> <body bgcolor="#ffffff" text="#000000"> skaller wrote: <blockquote cite="mid1186226538.14440.105.camel@rosella.wigram" type="cite"> <pre wrap="">On Sat, 2007-08-04 at 12:29 +0200, Philippe Wang wrote: </pre> <blockquote type="cite"> <pre wrap=""><a class="moz-txt-link-abbreviated" href="mailto:tmp123@menta.net">tmp123@menta.net</a> wrote: </pre> </blockquote> <pre wrap=""><!----> </pre> <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 first. Please, has someone any sugestion? Thanks a lot. </pre> </blockquote> </blockquote> <pre wrap=""> You must keep a list of functions to fire off at a given time, so the map will be time -> timerid list and you'll also need timerid -> time * (unit->unit) to fetch the function from the id. </pre> </blockquote> Hello,<br> <br> Thanks for the sugestion.<br> <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> <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> <br> I do not see solution for that.<br> <br> Kind regards.<br> </body> </html>