lua-users home
lua-l archive

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

Am 28.11.2013 11:44 schröbte John Hind:

Again, if 'ipairs' can be (rather trivially) implemented in Lua, and has an alternative mechanism in the language which is, at worst, almost as good, how can it be justified in a language that aspires to minimalism? As I said before, I do not want to ban it, just to stop privileging it!

I guess `for k,v in next, t, nil do ... end` was too ugly, so `pairs` was added, and `ipairs` came along as the other main table iteration method. In Lua 5.2 you need `debug.getmetatable` to implement `(i)pairs`, btw.