caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: henridf@lcavsun1.epfl.ch
To: caml-list@inria.fr
Subject: [Caml-list] let rec when not recursive
Date: Thu, 24 Apr 2003 15:58:12 +0200 (CEST)	[thread overview]
Message-ID: <Pine.LNX.4.44.0304241551440.24099-100000@lcmpc4.epfl.ch> (raw)

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


             reply	other threads:[~2003-04-24 13:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-24 13:58 henridf [this message]
2003-04-24 14:05 ` Mike Lin
2003-04-24 17:47 ` Chris Hecker

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=Pine.LNX.4.44.0304241551440.24099-100000@lcmpc4.epfl.ch \
    --to=henridf@lcavsun1.epfl.ch \
    --cc=caml-list@inria.fr \
    --cc=henri.dubois-ferriere@epfl.ch \
    /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).