3 ms·
Here's a starting point: https://wiki.tcl-lang.org/page/New+Control+Structures https://wiki.tcl-lang.org/page/New+Control+Structures
by davidw 7y ago
Here's a starting point: https://wiki.tcl-lang.org/page/New+Control+Structures https://wiki.tcl-lang.org/page/New+Control+Structures
- blacksqr 7y agotl;dr Tcl has an "uplevel" command that lets you execute code in the variable scope level of the procedure that called it. The classic example is a "do" loop, which Tcl doesn't include out of the box: proc do {body condition} { while 1 { uplevel $body if {![uplevel [list expr $condition]]} break } } set i 10 do {puts $i ; incr i -1} {$i > 0} output: 10 9 8 7 6 5 4 3 2 1