From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id PAA10163; Thu, 24 Apr 2003 15:51:38 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id PAA10757 for ; Thu, 24 Apr 2003 15:51:37 +0200 (MET DST) Received: from lcavsun1.epfl.ch (lcavsun1.epfl.ch [128.178.8.3]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h3ODpaH27646 for ; Thu, 24 Apr 2003 15:51:36 +0200 (MET DST) Received: from lcmpc4.epfl.ch (lcmpc4.epfl.ch [128.178.8.59]) by lcavsun1.epfl.ch (8.8.8+Sun/8.8.8) with ESMTP id PAA08750 for ; Thu, 24 Apr 2003 15:51:35 +0200 (MET DST) Date: Thu, 24 Apr 2003 15:58:12 +0200 (CEST) From: henridf@lcavsun1.epfl.ch X-X-Sender: henridf@lcmpc4.epfl.ch Reply-To: Henri DF To: caml-list@inria.fr Subject: [Caml-list] let rec when not recursive Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam: no; 0.00; henridf:01 lcavsun:01 callback:01 sched:01 'let:01 rec':01 handler:01 rec:01 recursive:03 argument:03 let:04 stuff:05 epfl:05 queue:05 body:93 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi, 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. hdf let rec clock_tick() = ( ... do stuff ... sched#sched_in ~handler:clock_tick ~t:1.0; ) ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners