lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Feb 18, 2009, at 8:45 AM, Roberto Ierusalimschy wrote:

One answer for coroutines in the scope manager pattern is that one needs not just on_exit and on_failure, but also the pair on_yield/ on_resume.

That seems too complicated for what should be an unusual situation.

True though actually yielding might not be that rare. On the other hand, I don't know how often it would be clear what to do on the way out and back in.

Do upvalues get processed when a coroutine gets collected?

Currently no.

Does a closure keep the coroutine in which it was created from being collected? If not, then isn't there a problem if upvalues don't get closed when the coroutine gets collected? Or maybe we miscommunicated since I failed to say "closed" in my earlier message.