3 ms·
Here's a hacky version of one of their examples, with "reactive Tcl", which is essentially powered by the trace command. proc timeB {varname seconds} {
by davidw 11y ago
Here's a hacky version of one of their examples, with "reactive Tcl", which is essentially powered by the trace command.
proc timeB {varname seconds} {
upvar $varname x
set x [clock seconds]
after [::tcl::mathop::* $seconds 1000] [list timeB $varname $seconds]
}
proc onChange {varname empty op} {
upvar $varname x
puts $x
}
timeB foobar 1
trace add variable foobar write onChange
vwait forever
Tcl - doing cool things before they were cool since 1990.