Posted to tcl by st3ve at Tue Apr 16 16:31:22 GMT 2013view raw

  1. # load itcl, make sure it's 3.4
  2. puts "itcl version is [package require Itcl]"
  3.  
  4. # define a breakable class
  5. itcl::class Crashy {
  6. constructor {} {
  7. return -level 0 -code error "crash now"
  8. }
  9. }
  10.  
  11. Crashy my_class
  12.  
  13. ---
  14.  
  15. silver:tmp steve$ ls -l /usr/local/bin/tclsh
  16. lrwxr-xr-x 1 root admin 8 Apr 3 09:15 /usr/local/bin/tclsh -> tclsh8.6
  17. silver:tmp steve$ /usr/local/bin/tclsh test.tcl
  18. itcl version is 3.4
  19. Segmentation fault: 11
  20.