[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Definition of a sequence
- From: Coda Highland <chighland@...>
- Date: Wed, 10 Jun 2015 11:34:40 -0700
On Wed, Jun 10, 2015 at 10:23 AM, Brigham Toskin
<brighamtoskin@gmail.com> wrote:
> On Tue, Jun 9, 2015 at 11:29 PM, Tim Hill <drtimhill@gmail.com> wrote:
>>
>> It’s late and i’m typing from memory .. but didn’t ipairs() finally settle
>> down to just stopping at the first nil (in 5.3 that is)?
>
>
> Yep.
>
> Lua 5.3.0 Copyright (C) 1994-2015 Lua.org, PUC-Rio
>> = #{1, nil, 3, 4}
> 4
>> for i,v in ipairs{1, nil, 3, 4} do print(i, v) end
> 1 1
Unless the table has a __len metamethod, at which point it uses that instead.
/s/ Adam
- References:
- Definition of a sequence, Dirk Laurie
- Re: Definition of a sequence, Tim Hill
- Re: Definition of a sequence, Dirk Laurie
- Re: Definition of a sequence, Tim Hill
- Re: Definition of a sequence, Dirk Laurie
- Re: Definition of a sequence, Tim Hill
- Re: Definition of a sequence, "书呆彭, Peng Yi"
- Re: Definition of a sequence, Andrew Starks
- Re: Definition of a sequence, Tim Hill
- Re: Definition of a sequence, Brigham Toskin