|
From: miguel s. <mig...@gm...> - 2008-08-28 11:34:09
|
Alexandre Ferrieux wrote: > Notice that here I'm not concentrating on the coroutine/continuation > difference. One motivation is that I predict that the free-floating > (as in "unordered") refcounted "stack" frames will be teleported from > Miguel's mind to silicon in no time (considering the timescale of the > 8.5 release ;-). So basically I assume that today's anchoring of > coroutine-sequels to the toplevel won't last long enough to be called > a limitation of the model ! Much flattered :) But ... what I may yet do before hell freezes over is running the same kind of coroutines in a slightly different way: they now run in [uplevel #0], I think I know how to let them "remember" the complete call stack at creation so that [upvar] and [uplevel] keep functioning even if the coroutine's creator has already returned. That is, so that the complete environment at creation time is captured - a real closure. What I do *not* know (yet?) how to do properly is to marry that approach with correct functioning of [info level], [info frame] and error stacks. Access to the resumer's environment via [uplevel] and [upvar] would still be barred, or else require some new mechanism if the need is felt. Note that today's coroutine make it look (for [info frame] and error stacks) as if whoever resumed a coroutine actually called the coroutine's body from the beginning. What should it look like for a continuation (let us call them that)? IOW, I am more worried about the proper semantics than the implementation, which is a SMOP (famous last words). |