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] let rec when not recursive
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-04-24 (13:51)
From: henridf@l...
Subject: [Caml-list] let rec when not recursive

I have a callback function which i would like to reschedule itself into 
the event queue that called it.
In order to be able to refer to the function within the body (ie, pass 
'clock_tick' as argument to sched#sched_in), the only think i could think 
of was to make it recursive, even though it isn't (because the 
sched#sched_in call returns immediately). 

Is this a perversion of the 'let rec' construct? Is there a better way to 
get around it? Thanks.


let rec clock_tick() = (
  do stuff

  sched#sched_in ~handler:clock_tick ~t:1.0;

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