lua-users home
lua-l archive

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


Perhaps something like:

function table.insert(t,k,v)
  if type(k) ~= 'number' or k %1 ~= 0 then
    t[k] = v
  else
    repeat
      t[k], v = v, t[k]
      k = k + 1
    until v == nil
  end
end

Tony.
--
f.anthony.n.finch  <dot@dotat.at>  http://dotat.at/