Posted to tcl by aspect at Mon Jun 01 15:55:06 GMT 2015view raw

  1. package require TclOO
  2.  
  3. oo::class create small_class1 {
  4. method hello {} {
  5. puts hello1
  6. next
  7. }
  8. }
  9.  
  10. oo::class create small_class2 {
  11. method hello {} {
  12. puts hello2
  13. next
  14. }
  15. }
  16.  
  17. oo::class create large_class {
  18. mixin small_class1 small_class2
  19. method hello {} {
  20. puts boo
  21. }
  22. }
  23.  
  24. large_class create myLargeObject
  25. myLargeObject hello
  26. # hello1
  27. # hello2
  28. # boo
  29.