[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: petition to keep ipairs alive
- From: Romulo <romuloab@...>
- Date: Wed, 19 May 2010 21:34:06 -0300
On Wed, May 19, 2010 at 9:27 PM, Mark Feldman
<mfeldman@infinite-interactive.com> wrote:
> It's trivial to add yourself, as demonstated in PIL:
>
> function iter (a, i)
> i = i + 1
> local v = a[i]
> if v then
> return i, v
> end
> end
Don't forget that "if v then" will evaluate both "nil" and "false" as
false. A more coherent condition is "if v ~= nil then"
--rb