lua-users home
lua-l archive

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

On Jun 9, 2014, at 7:25 PM, Thiago L. <> wrote:

> Last I checked, `for x,y in ipairs(t) do` is slower than `for x=1,#t do local y = t[x]`, so why do we have ipairs()?

One reason is that ipairs() is generic via the __ipairs() metamethod.