lua-users home
lua-l archive

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

Thanks to everyone, now I get it.


On Tue, Feb 16, 2010 at 6:31 PM, Javier Guerra <> wrote:
On Tue, Feb 16, 2010 at 11:56 AM, Valerio Schiavoni
> coroutine.create(coroutine.yield())

as Peter pointed, coroutine.yield() is being called from the main
thread.  it tries to yield to the calling function, but that's the
executable environment, which is a C program. that explains the error.

the 'minimal and useless' equivalent code is the one suggested by Michal:

coroutine.create(function() coroutine.yield() end)

here you define an anonymous Lua function that only calls
coroutine.yield(), and gives it to coroutine.create()