Posted to tcl by aspect at Wed Mar 11 03:55:53 GMT 2015view raw
- package require lambda
- proc finally {script} {
- set v [lindex [uplevel 1 {info locals}] 0]
- puts "binding to $v"
- tailcall trace add variable $v unset [lambda args $script]
- }
- proc test {div} {
- set x 1.0
- finally {puts "returning"}
- puts "doing stuff"
- }