Skip to content

Instantly share code, notes, and snippets.

View arthurschreiber's full-sized avatar

Arthur Schreiber arthurschreiber

View GitHub Profile
@sstephenson
sstephenson / let.tcl
Created March 17, 2011 14:04
Lexical scoping in Tcl
#!/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]]