lua-users home
lua-l archive

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


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. :-)