lua-intf icon indicating copy to clipboard operation
lua-intf copied to clipboard

Unlimited parameters in function

Open TheAifam5 opened this issue 9 years ago • 2 comments

Hi, Its possible to make unlimited parameters like for printf in LuaIntf? For example:

LuaBinding(luaContext).addFunction("printf", &printf)

I found this: http://lua-users.org/wiki/LuaPrintf And i think is possible to make that.

Regards TheAifam5.

TheAifam5 avatar May 04 '16 15:05 TheAifam5

You can not add function with ... argument directly, there is no such binding for LuaIntf. You can, however, implement CFunction like function to access lua stack, and having unlimited arguments.

SteveKChiu avatar May 06 '16 03:05 SteveKChiu

Yea, then theoretically could be possible by using va_args and lua stack. I’m not good at this btw :D

TheAifam5 avatar Nov 05 '18 18:11 TheAifam5