local function f(...) local t = table.pack(...) return table.unpack(t, 1, t.n - 1) end print(f(1, 2, 3, 4)) print(f("a", "b", "c", "d"))