Posted to tcl by evilotto at Tue Dec 08 23:29:10 GMT 2015view raw

  1. oo::class create Aclass {
  2. method thing {} {
  3. callthings
  4. }
  5. method nothing {} {
  6. my destroy
  7. callthings
  8. }
  9. }
  10.  
  11. proc callthings {} {
  12. foreach obj [info class instances Aclass] {
  13. puts "$obj -> [info object class $obj]"
  14. }
  15. }
  16.  
  17. Aclass create foo
  18. Aclass create bar
  19. foo thing
  20. bar nothing