coroutine

coroutine name cmd ?arg ...?

Makes a command name and runs cmd until its first yield. The value of that yield is the result of coroutine. Each call of name goes on to the next yield, and its argument is the result of that yield. The coroutine ends when cmd returns.

Examples

A click on an example runs it in the shell of the page.

Facts

Differences from Tcl 8.6