lua-users home
lua-l archive

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

The manual states that lua_yield "should only be called as the return expression of a C function".

Can I have a conditional yield on return? e.g. is this valid or could it give trouble (possibly depending on the compiler)?

 if (mustYield) {
     return lua_yield(lua, 0);
 } else {
     return 0;

I suppose so, but just to be safe...