Posted to tcl by hypnotoad at Fri Dec 04 20:04:17 GMT 2015view raw
- oo::class create Destroyer {
- destructor {
- my sink
- puts "Destructor Called"
- }
- method sink {} {
- puts "Sink Called"
- my destroy
- puts "Sink Carried on"
- }
- method reallySink {} {
- puts "ReallySink"
- my destroy
- my sink
- puts "/ReallySink"
- }
- }
- puts [info command one]
- Destroyer create one
- one reallySink
- puts [info command one]
- Destroyer create two
- puts [info command two]
- rename two {}
- puts [info command two]
- =================
- baccarat:cron seandeelywoods$ tclsh tcloo.tcl
- ReallySink
- Sink Called
- Sink Carried on
- Destructor Called
- Sink Called
- Sink Carried on
- /ReallySink
- two
- Sink Called
- Sink Carried on
- Destructor Called