Posted to tcl by dgp at Thu Jun 13 14:50:03 GMT 2019view raw

  1. $ cat evtest.tcl
  2. namespace eval provide {
  3. proc irk args {puts BROKEN!}
  4. proc every {ms script} {
  5. puts $script
  6. try $script
  7. after $ms [list after idle [namespace code [info level 0]]]
  8. }
  9. namespace export every
  10. }
  11. namespace eval consume {
  12. namespace import ::provide::every
  13. rename every irk
  14. irk 1000 {puts TICK}
  15. }
  16. vwait forever
  17.  
  18. $ tclsh evtest.tcl
  19. puts TICK
  20. TICK
  21. BROKEN!
  22.