From: François PERRAD <[EMAIL PROTECTED]>
Date: Tue, 10 Oct 2006 13:39:30 +0200
Thank for your long response.
I included your code in languages/lua/lib/luacoroutine.pir (r14877).
I encountered 2 problems :
1) coroutine_yield needs a current coroutine (not surprising)
Yes, this is the "implicit current coroutine" problem I mentioned. I
think this is best solved with a dynamically-bound variable, the value
of which Lua's "coroutine.running" can just return.
2) I want replace the LuaThread PMC by a PIR classe . . .
some test of languages/lua/t/coroutine.t fail with the following
message :
FixedPMCArray: index out of bounds!
François.
On Sunday, to see if it would work, I created a Parrot::Coroutine class,
and it works like a charm. I haven't committed it yet because it needs
a test case. This will be an extended version of the "same fringe" demo
but converted into a proper example; it's also an excellent workout for
closures.
So please stay tuned.
-- Bob