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