lua-users home
lua-l archive

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


A more efficient solution (avoids copying the table):

function my_unpack(t, i, n)
  i = i or 1
  n = n or table.getn(t)
  if i <= n then
    return t[i], my_unpack(t, i+1, n)
  end
end

-- Roberto