From: Alexandre F. <ale...@gm...> - 2008-08-29 16:39:24
|
Again, a followup would be appreciated... On Fri, Aug 29, 2008 at 1:23 AM, Alexandre Ferrieux <ale...@gm...> wrote: > On 8/29/08, Lars Hellström <Lar...@re...> wrote: >> >> Essentially, that is "keeping a GUI alive during a long-running computation". >> [...] >> That much can be done with the NRE [coroutine] too > > Indeed. See: > http://groups.google.com/group/comp.lang.tcl/tree/browse_frm/thread/7244a14c3a82b090/cd94a2dff6910b36?hl=en&rnum=1&q=in+head&_done=%2Fgroup%2Fcomp.lang.tcl%2Fbrowse_frm%2Fthread%2F7244a14c3a82b090%2F2361d9dc487bd8d9%3Fhl%3Den%26lnk%3Dgst%26q%3Din%2Bhead%26#doc_4244d504a9b42828 > >> -- however it turned out >> that the basic [suspend] and [resume] primitives I came up with to solve the >> above problem could also do a lot more than this. > > Yeah, I'm impatient to know what. > >> And the basic problem of running multiple animations simultaneously can of >> course be handled with only Tcl/Tk 8.5 features, as is the case with >> anything that [coroutine] lets you do AFAICT, but this may require you to >> restructure your code in a rather unintelligible way. > > That is true but does not shed light on the *need* for > [suspend/resume] instead of [coroutine]: Classical event-driven style > imposes non-contiguous code, while both [coroutine] and your approach > allow for straightforward style -- this doesn't break the tie. > >> > > Also, from time to time people hint at the fact that passing a >> > > continuation or coroutine across the thread/interp boundary would be >> > > Overly Cool, but again I'd like a few examples of what real problems >> > > this would solve. > >> I have no idea why that should be cool -- Miguel had however mentioned it as >> something the NRE [coroutine]s cannot do, so I thought it worth pointing out >> that you get it for free with [suspend]/[resume]. Maybe he can elaborate on >> the usefulness of this however. > > So, if you have no personal interest in serialized continuations *and* > just want the linear style that [coroutine] already provides, what's > the point ? > > -Alex > |