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
280 B
Tcl
14 lines
280 B
Tcl
proc for-each-line {var lines body} {
|
|
foreach item $lines {
|
|
uplevel 1 [list set $var $item]
|
|
uplevel 1 $body
|
|
}
|
|
}
|
|
|
|
# Usage: accumulate lengths of each "line"
|
|
set total 0
|
|
for-each-line line {hello world foo} {
|
|
incr total [string length $line]
|
|
}
|
|
set total
|