Posted to tcl by apw at Mon Jun 30 08:50:07 GMT 2008view raw

  1. I think Donal was right in having no error is there is no next call possible, see the following example:
  2.  
  3. without the next in class cl1, cl3 constructor cannot be called, but with the next command in, there is a problem for creation of obj2, as there is no next command to be called.
  4.  
  5.  
  6. #!/usr/bin/env tclsh
  7.  
  8. package require TclOO 0.4
  9.  
  10. ::oo::class create cl1 {
  11. constructor {args} {
  12. puts stderr "cl1::constructor"
  13. next
  14. }
  15. }
  16.  
  17. ::oo::class create cl2 {
  18. superclass cl1
  19.  
  20. constructor {args} {
  21. next
  22. puts stderr "cl2::constructor"
  23. }
  24. }
  25.  
  26. ::oo::class create cl3 {
  27. constructor {args} {
  28. puts stderr "cl3::constructor"
  29. }
  30. }
  31.  
  32.  
  33. ::oo::class create cl4 {
  34. superclass cl2 cl3
  35.  
  36. constructor {args} {
  37. puts stderr "cl4::constructor"
  38. next
  39. }
  40. }
  41.  
  42. puts stderr "creating obj1"
  43. cl4 create obj1
  44. puts stderr "creating obj2"
  45. cl2 create obj2
  46.