lua-users home
lua-l archive

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


David Given wrote:
[...]
How does yield() know where to transfer execution to? Does it go to the most recent resume() that caused the current coroutine to be run?
yes.
yield() returns to the caller of the coroutine, ie. coroutine.resume() will return when the resumed coroutine yields, returns, or dies.

Adrian