[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lua-l
Subject:    va_arg in lua?
From:       "Ashley Fryer" <lua () bmarket ! com>
Date:       1999-11-05 22:55:32
Message-ID: 006f01bf27e0$dd5ab490$2a00a8c0 () p450
[Download RAW message or body]

Hi all,

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

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
end

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
this?

Thanks in advance,
ashley



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic