[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Conditional lua_yield
- From: "Duncan Cross" <duncan.cross@...>
- Date: Fri, 31 Oct 2008 10:54:50 +0000
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