tcl::unsupported::inject
tcl::unsupported::inject coroName cmd ?arg ...?
Puts a command in a suspended coroutine. At the next resume the command runs in the coroutine with its own words only, and the coroutine goes on. The form of Tcl 8.6 of coroinject.
Examples
A click on an example runs it in the shell of the page.
coroutine c apply {{} {yield; return $::x}}; set x 1; tcl::unsupported::inject c set ::x 2; c:2
Facts
- Capability: none.
- Compute cost: one compute unit for the call, and more for the commands that it runs.