lua-users home
lua-l archive

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

I was attempting:

__ipairs = function(t, i)
i = i or -1
return function(t, i)
i = i + 1
local v = hidden_table[i]
if v then
return i, v
end, t, i


However, I was surprised to see that `__ipairs` adjusts the argument list to 1. I refactored to make this work with a plain old for loop and it's not a huge deal, but it was not "least surprising."

I would think that the number of arguments passed into `ipairs` is  none of Lua's business... por que?