Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 42s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
14 lines
215 B
Tcl
14 lines
215 B
Tcl
proc with-temp-var {varname tempval body} {
|
|
upvar 1 $varname v
|
|
set saved $v
|
|
set v $tempval
|
|
uplevel 1 $body
|
|
set v $saved
|
|
}
|
|
|
|
set x 100
|
|
with-temp-var x 999 {
|
|
set captured $x
|
|
}
|
|
list $x $captured
|