[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: use of gettop to change functionality
- From: Renato Maia <maia@...>
- Date: Wed, 2 Mar 2011 08:51:50 -0300
On 2 Mar 2011, at 05:43, steve donovan wrote:
However, a simple C extension P could be written that could make 'for
i,v in P(...) do' pretty optimal - it's very efficient to access
multiple arguments in C.
I don't know about how optimal it is, but anyone interested can take a
look at library 'vararg' (http://luarocks.org/repositories/rocks/
#vararg) that allows you to do:
for i, v in vararg.pack(...) do
It creates an new closure for each call of 'vararg.pack' and the
number of elements in the '...' cannot exceed 254 elements.