Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
Adds lib/tcl/conformance.sh: runs .tcl programs through the epoch protocol, compares against # expected: annotations, writes scoreboard.json and scoreboard.md. All 3 classic programs pass. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
15 lines
235 B
Tcl
15 lines
235 B
Tcl
# expected: 100 999
|
|
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
|