lua-users home
lua-l archive

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

?>Finally, `pairs` and `ipairs` are not essential functions, so we could
avoid the issue by just eliminating them (although that was tried and
rejected [3]).

I once again raise the suggestion of making ipairs- and pairs- functionality 2 more types of for loop ('for i, v over t do' and 'for k, v of t do'), with the former using 'local i,v=1 while t[i] do k=t[i] <...> i=i+1 end' semantics and the latter using 'local k,v = next(t) while t[k] do v=t[k] <...> k=next(t,k) end'.

Also, shouldn't next(), pairs(), and ipairs() technically go in the "table" library with unpack()?