Posted to tcl by aspect at Tue Apr 04 01:06:35 GMT 2017view raw

  1. coroutine coro while 1 yield
  2. proc test {a} {
  3. puts "Test: $a"
  4. test [expr {$a + 1}]
  5. }
  6.  
  7. for {set i 0} {$i < 998} {incr i} {
  8. tcl::unsupported::inject coro {incr ::j}
  9. }
  10. test 1
  11. puts Finished
  12.  
  13. # Test: 1
  14. # too many nested evaluations (infinite loop?)
  15. # while executing
  16. # "puts "Test: $a""
  17. # (procedure "test" line 2)
  18. # invoked from within
  19. # "test [expr {$a + 1}]"
  20. # (procedure "test" line 3)
  21. # invoked from within
  22. # "test 1"
  23. # (file "x.tcl" line 10)
  24.