This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env TEST=1 tclsh | |
# Lexical scoping in Tcl | |
proc let {block args} { | |
try { | |
set captured_vars [uplevel [list capture [block args]]] | |
set all_var_names [uplevel {info vars}] | |
foreach var [block args] value $args { | |
uplevel [list catch [list unset $var]] |