[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Coroutine bug?
- From: Lorenzo Donati <lorenzodonatibz@...>
- Date: Mon, 20 Jun 2011 11:46:57 +0200
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.