lua-users home
lua-l archive

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


On Fri, Oct 31, 2008 at 10:46 AM, Enrico Colombini <erix@erix.it> wrote:
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...

  Enrico

Yes, that's fine.

-Duncan