Posted to tcl by colin at Mon May 31 00:50:12 GMT 2010view raw

  1. proc c {} {
  2. yield
  3. error "This will explode"
  4. }
  5.  
  6. proc cc {} {
  7. coroutine C c ;# C is created, and contains cc's stack
  8. }
  9.  
  10. proc boom {} {
  11. cc
  12. C ;# C still references the now-defunct cc stack
  13. }
  14.  
  15. boom