Posted to tcl by aspect at Wed Sep 10 08:34:21 GMT 2014view raw

  1. oo::class create klass {
  2. superclass oo::class
  3. constructor args {
  4. next {*}$args
  5.  
  6. set methods [info class methods [self object]] ;# maybe use -all?
  7. assert {"foo" in $methods}
  8. # .. etc
  9. }
  10. }
  11.  
  12. klass create Okay {
  13. method foo args {
  14. puts ok
  15. }
  16. }
  17.  
  18. klass create Nope {
  19. method foo args {
  20. puts ok
  21. }
  22. }
  23.