Posted to tcl by sebres at Thu Nov 14 16:42:16 GMT 2019view raw

  1. oo::class create c1 {
  2. method m1 {} {
  3. puts !!!!!c1::m1!!!!
  4. }
  5. }
  6.  
  7. oo::class create c2 {
  8. superclass c1
  9. destructor {
  10. puts ===destructor=1=
  11. my m1
  12. puts ===destructor=2=
  13. }
  14. method m1 {} {
  15. puts ===delete-self***
  16. rename [self] {}
  17. puts ===no-self***
  18. next
  19. }
  20. }
  21.  
  22. c2 create obj1
  23. obj1 m1
  24.  
  25.  
  26. 1)
  27. ===delete-self***
  28. ===destructor=1=
  29. ===delete-self***
  30. ===no-self***
  31. !!!!!c1::m1!!!!
  32. ===destructor=2=
  33. ===no-self***
  34. !!!!!c1::m1!!!!
  35.  
  36. 2)
  37.  
  38. ===delete-self***
  39. ===destructor=1=
  40. ===delete-self***
  41. ===no-self***
  42. !!!!!c1::m1!!!!
  43. ===destructor=2=
  44. ===no-self***
  45. no next method implementation
  46. while executing
  47. "next"
  48. (class "::c2" method "m1" line 5)
  49. invoked from within
  50. "obj1 m1"
  51. (file "e:/test-oo-sf" line 23)