Posted to tcl by pooryorick at Thu Aug 30 20:17:19 GMT 2018view raw

  1. oo::class create A {
  2. variable var1
  3. method m2 {} {
  4. return var1
  5. }
  6. }
  7.  
  8. oo::class create B {
  9. superclass A
  10. variable var1
  11. constructor {} {
  12. set var1 hello
  13. }
  14. method m1 {} {
  15. return $var1
  16. }
  17. }
  18.  
  19. B create b1
  20.