[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: resuming a into dofile
- From: Mike Pall <mikelu-0707@...>
- Date: Fri, 20 Jul 2007 13:45:34 +0200
> I am trying to do the following: create a coroutine, run a dofile inside it,
> yielding from the file called with dofile, then resuming again the
This doesn't work since dofile() is a library function written in
C and you cannot yield across a C call boundary (search the
archives for lots of explanations about this).
But you can just replace
That's a plain call in the 2nd case, so you can yield from inside
the second file.
> coroutine.resume (cof)
You should really check the result of coroutine.resume(), e.g.:
Then you would have noticed the error:
"attempt to yield across metamethod/C-call boundary"