Joe English wrote:
> miguel sofer wrote:> >> The idea is that>> yieldTo foo bar sum>> will:>> 1. suspend the currently running coro>> 2. cause the coro's caller to invoke [foo bar sum] in the place of>> the current coro, and take it's return value as the coro's return value>>>> IOW: it works EXACTLY like [tailcall] in the sense that the currently>> running thing is removed from the call stack and replaced by a new>> command. The difference is that where [tailcall] terminates the>> currently running proc, [yieldTo] suspends the currently running coro.> > OK, so if you have:> > proc A {...} {> coroutine coro1 B ...> }> > then in proc B:> > yieldto C args...> > is the same as:> > yield [C args...]> > except that:> > (a) [uplevel 1] in the body of proc C will refer to proc A,> not proc B; and:> (b) C may call coro1.> > Do I have that right?
Yes. There are of course additional internal details in terms of stack
consumption and suchlike, but irrelevant to the semantics.
------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Tcl-Core mailing list
Tcl-...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tcl-core