lua-users home
lua-l archive

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


If ipairs would accept start and end indices (like unpack for example) then instead of;

for i = 20, 30 do
  local obj = list[i]
  
  -- do some stuff with obj

end

I could write;

for i, obj in ipairs(list, 20, 30) do

  -- do some stuff with obj

end

Thoughts? (besides that I could write my own iterator and all the undefined stuff for non-contignuous tables etc)

Thijs