lua-users home
lua-l archive

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


On Sun, Jun 9, 2013 at 8:07 PM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
> 2013/6/10 Coda Highland <chighland@gmail.com>:
>
>> This means that "for
>> i = 1,#t" and "for i,_ in ipairs(t)" can have different results.
>
> So supply  __ipairs.
>
> With __len available, the safe thing to do is to use it. E.g.
> let it return the value of a field `n` in your array, such as
> table.unpack so helpfully supplies.
>
> We've come a long way since 4.0, let's say about 400
> metres on a standard athletics track. :-)
>

Oh, of course, I'm not discounting this, just pointing out an
important note about the semantics, since we were discussing them.

/s/ Adam