Posted to tcl by aspect at Thu Dec 24 03:22:33 GMT 2015view raw
- proc coEvery {option args} {
- coroutine Create#[incr Counter] Create $option {*}$args
- }
- proc Create {option args} {
- puts "Create $option $args"
- Execute $option {*}$args
- }
- proc Execute {delay args} {
- puts "Execute $delay $args"
- after $delay [info coroutine]
- yield
- {*}$args
- Execute $delay {*}$args
- }