lua-users home
lua-l archive

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

Hi all,

Seems like this question was asked before, but I can't it in the archives,

Is there some way to read a variable number of arguments passed to a lua
function without using a table?  Something like va_arg in C?

In C, I'd like to:

for( n )
    lua_pushnumber( foo );

Then in Lua, I'd like to:

function my_func( first, ... )
   -- be able to know that n args were passed,
   -- and read them

I know that normally a table would be the thing to use, but for esoteric
reasons on the C side, a table is less-than-ideal.  Is there any way to do

Thanks in advance,