# core.tcl --
proc x {} {
    set x 1
}

proc foo {} {
    after 1000 {set ::go 1}
    vwait ::go
}

proc es {args} {
    puts $args
    trc remove
    foo
    trc add
    puts "done"
}

proc ls {args} {
    puts $args
    trc remove
    foo
    trc add
    puts "done"
}

proc trc {m} {
    trace $m execution ::x leavestep ls
    trace $m execution ::x enterstep es
}

trc add
x


