lua-users home
lua-l archive

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

> I've tried a few things along these lines but without much luck. I
> think the main problem is just that I don't have a good understanding
> of how yields and resumes operate.

That really makes things difficult...

> Hence, I figure that yield/resume do something I'm not expecting, or
> don't understand. I'd appreciate a simple example of how to use
> lua_yield in a C hook function, if at all possible!

    return lua_yield(L, 0);

That is it.

As I told you, C hooks are not regular lua_Cfunctions. In particular, you
cannot use lua_*k functions inside them. This case of 'lua_yield' is
handled separately in the VM, as a special case.

-- Roberto