Re: Iterate over vararg
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Iterate over vararg
- From: Gabriel Bertilson <arboreous.philologist@...>
- Date: 2018年12月20日 17:56:17 -0600
I went with
if (0 < i && i <= 256 && !lua_isnone(L, lua_upvalueindex(i))) { ... }
— Gabriel
On Thu, Dec 20, 2018 at 5:17 PM Stephen Irons <stephen@irons.nz> wrote:
>
>
>
> On Fri, Dec 21, 2018 at 6:12 AM, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
>
> Thank you, that simplifies the code. [...]
>
> - if (!lua_isnone(L, lua_upvalueindex(i))) { + if (0 < i <= 256 && !lua_isnone(L, lua_upvalueindex(i))) {
>
>
> I don't think the expression (0 < i <= 256) does what you expect in C. Do you mean ((i > 0) && (i <= 256)), or perhaps this was intended as psuedo-code?
>
> -- Roberto