home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / tcl / 1312 < prev    next >
Encoding:
Text File  |  1992-09-08  |  1.3 KB  |  28 lines

  1. Newsgroups: comp.lang.tcl
  2. Path: sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!menudo.uh.edu!sugar!karl
  3. From: karl@NeoSoft.com (Karl Lehenbauer)
  4. Subject: Re: Periodic Actions in Tcl/Tk
  5. Organization: NeoSoft Communications Services -- (713) 684-5900
  6. Date: Mon, 07 Sep 1992 17:15:34 GMT
  7. Message-ID: <1992Sep07.171534.19571@NeoSoft.com>
  8. References: <VEK.92Aug31115650@rover.allegra.att.com>
  9. Lines: 17
  10.  
  11. In article <VEK.92Aug31115650@rover.allegra.att.com> vek@allegra.att.com (Van Kelly) writes:
  12. >What is the best way to define a period action (say, once every n seconds)
  13. >in a Tcl/TclX/Tk environment, given that there may be a number of these
  14. >one might wish to set up and later selectively cancel at a later date.
  15.  
  16. >The first thing I thought of was to have a global variable, say FOO,
  17. >containing the code for a periodic action followed by an after command
  18. >to re-evaluate itself.  But this is obviously tail-recursive and may
  19. >explode its stack pretty fast.  
  20.  
  21. It isn't tail-recursive, it is still iterative.  The "after" command simply
  22. schedules some command to execute later, so it is fine for a procedure
  23. to reschedule itself with "after".
  24. -- 
  25. -- Email info@NeoSoft.com for info on getting interactive Internet access.
  26. You will now awaken feeling relaxed and refreshed, remembering everything 
  27. you've read except the details of the Omega contingency plan.
  28.