I have functions inside a Lua table t
and I learned that I can list all the functions the t
contains by running the following script:
for k, v in pairs(t) do
print(k, v)
end
It will for example print:
myfunction1 function: 0x107219805
myfunction2 function: 0x10721c194
myfunction3 function: 0x1071e067c
Now, I would like to know if it's possible to get each function's number of arguments it expects. So the result can be like the following:
myfunction1 function: 0x107219805 arguments: 3
myfunction2 function: 0x10721c194 arguments: 4
myfunction3 function: 0x1071e067c arguments: 5
Would this be possible in Lua? Or using the C API?
...
)? Anyway I don't think this is possible. – csaardebug.getinfo
is, itself, an example of this. – Tom Blodget