Posted to tcl by colin at Wed Nov 17 01:45:08 GMT 2010view raw

  1. proc reader {} {
  2. ::yield
  3. }
  4.  
  5. oo::class create ::Lamb {
  6. method reader {} {
  7. ::yield
  8. variable var
  9. puts stderr "Var: $var"
  10. }
  11.  
  12. constructor {} {
  13. variable var 1
  14. ::coroutine ::meh [self] reader ;# will crash
  15. #::coroutine ::meh reader ;# will not crash
  16. }
  17. }
  18.  
  19. [::Lamb new] destroy
  20. foreach o [info class instances ::Lamb] {
  21. catch {info object namespace $o} e eo
  22. puts "1: $e ($eo)"
  23. }
  24. ::meh die
  25. foreach o [info class instances ::Lamb] {
  26. catch {info object namespace $o} e eo
  27. puts "2: $e ($eo)"
  28. }