====== # returns an unused procedure name proc gensym {prefix} { tailcall apply {{prefix} { string cat $prefix[llength [info commands $prefix*]] }} $prefix } # creates an anonymous coroutine proc go {cmd args} { set name [gensym goro#] coroutine $name $cmd {*}$args return $name } ====== Credit for the above code goes to [aspect]. The odd construct with `tailcall apply` is so that [info commands] will be executed in the caller's namespace. <>Concurrency