lua-users home
lua-l archive

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


On 20/06/2011 7.13, Lorenzo Donati wrote:

[replying to myself to amend a copy/paste mistake]

The last section should read (added emphasis on the corrected word):

When you resume the *FIRST* coroutine for the second time (third call to
resume), its execution resumes where it yielded (in the while loop), but
then you call check (global), which retains the closure created _in the
second coroutine_ (with ITS obj upvalue, i.e. that created in the second
call to resume), so "check" prints out the data for the "obj" argument
of the second coroutine.



-- Lorenzo