News for hackers. Stuff that matters.
Re:Reactive Ruby by davidw on Monday December 14, 2015 @04:53PM (#10734212)
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.

There are no comments on this comment yet.