|
From: Kevin K. <kev...@gm...> - 2009-12-07 14:33:23
|
Donal K. Fellows wrote: > So, the following should be equivalent, for any [foo]? > > yieldTo foo bar > yield [foo bar] > > Except that [foo] might see a different stack context? What will be the > cost of making a new short-lived context in the non-coro case? What will > [info coroutine] return inside the body of [foo] in the non-coro case? As Miguel explained it to me, [yieldto] executes the yielded-to command in place of the call to the current coroutine and in the caller's scope. (Except that the command is resolved in the current scope before yielding?) So I'd expect that [info coroutine], if [foo] is not a coroutine, will be whatever coroutine called the one that yielded. Oh, by the way, answering your earlier question: yieldTo the main coroutine will *not* be possible, because you can't yield to (or otherwise call) a coroutine that is on the stack, and the main coroutine is always there. -- 73 de ke9tv/2, Kevin |