lua-users home
lua-l archive

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


How about

t = { a = 1, b = 2, c = 3, [4] = 4}
local k = next(t)
while k do
  t[k] = nil
  k = next(t)
end


Is this OK?

t = { a = 1, b = 2, c = 3, 4 = 4}

for k in pairs (t) do
   t [k] = nil
end -- for