lua-users home
lua-l archive

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


2018-01-20 10:43 GMT+01:00 Paige DePol <lual@serfnet.org>:
Sean Conner <sean@conman.org> wrote:

>  Why not the following?
>
>       function foo(...)
>         for i = 1 , #... do
>           print("the answer is",...[i])
>         end
>       end


As you stated, if the vargs are needed in a table simply using "..." in
a table constructor could also be used.


IIR I proposed a patch in that spirit that a while back. Maybe list history can unearth it. Wasn't production ready though, my knowledge of Lua internals wasn't good enough.

--
Benoit.