Posted to tcl by colin at Sun Nov 14 22:12:45 GMT 2010view pretty

oo::class create Foo {
    destructor {
	variable live 0
	puts stderr "destroying"
    }
    method bar {} {
	variable live 1
	my destroy
	puts stderr "It LIVES $live"
    }
}

Foo create moop
moop bar