On 7 Dec 2009, at 14:09, Donal K. Fellows 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.>>>> You can yieldTo any command, it can be a suspended coro but doesn't >> have>> to be>> So, the following should be equivalent, for any [foo]?>> yieldTo foo bar> yield [foo bar]
Or perhaps "yield [list foo bar]" and have the caller do "eval
[$coro]"? Isn't that exactly what yieldTo does, but hiding the [eval],
or am I still missing something?
-- Neil
------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing.
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
Tcl-Core mailing list
Tcl-...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tcl-core