| Store | Cart

Re: [TCLCORE] Question on coroutines

From: Neil Madden <n...@Cs.Nott.AC.UK>
Mon, 7 Dec 2009 14:31:10 +0000
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

Recent Messages in this Thread
miguel sofer Dec 05, 2009 10:25 pm
Donal K. Fellows Dec 07, 2009 01:04 am
Kevin Kenny Dec 07, 2009 02:47 am
Larry McVoy Dec 07, 2009 02:56 am
Kevin Kenny Dec 07, 2009 04:41 am
Neil Madden Dec 07, 2009 09:35 am
miguel sofer Dec 07, 2009 01:41 pm
Kevin Kenny Dec 07, 2009 02:24 pm
Donal K. Fellows Dec 07, 2009 01:08 pm
miguel sofer Dec 07, 2009 01:20 pm
Donal K. Fellows Dec 07, 2009 02:09 pm
miguel sofer Dec 07, 2009 02:24 pm
miguel sofer Dec 07, 2009 04:44 pm
Neil Madden Dec 07, 2009 02:31 pm
Kevin Kenny Dec 07, 2009 02:44 pm
Neil Madden Dec 08, 2009 01:10 pm
Donald G Porter Dec 08, 2009 02:15 pm
miguel sofer Dec 08, 2009 02:22 pm
Kevin Kenny Dec 07, 2009 02:33 pm
Joe English Dec 08, 2009 06:08 pm
miguel sofer Dec 08, 2009 06:15 pm
Messages in this thread