Posted to tcl by crshults at Mon Jun 01 15:42:25 GMT 2015view raw

  1. package require TclOO
  2.  
  3. oo::class create small_class {
  4. constructor {} {}
  5. method hello {} {puts hello}
  6. }
  7.  
  8. oo::class create large_class {
  9. constructor {} {
  10. small_class create myFirstSmallObject
  11. small_class create mySecondSmallObject
  12. }
  13.  
  14. method hello {} {
  15. myFirstSmallObject hello
  16. mySecondSmallObject hello
  17. }
  18. }
  19.  
  20. large_class create myLargeObject
  21. myLargeObject hello
  22.