[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Catching and passing multiple values
- From: Javier Guerra <javier@...>
- Date: Thu, 23 Feb 2006 12:42:54 -0500
On Thursday 23 February 2006 12:27 pm, Javier Guerra wrote:
> On Thursday 23 February 2006 11:50 am, Chris wrote:
> > That made me think, a substring style unpack could be useful.
>
> this seems to work:
(snip C code)
>
lua (5.0) equivalent:
function split (n, ...)
local a = {}
for i = 1, n do
table.insert (a, table.remove (arg, 1))
end
table.insert (a, arg)
return unpack (a)
end
now... would there be any significant performance difference?
--
Javier
Attachment:
pgp9pDtECPVjY.pgp
Description: PGP signature