lua-users home
lua-l archive

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



Am 10.12.2012 um 21:53 schrieb Sven Olsen:


I would like to read the function name on the stack element i. How can I read the name?

It looks like you're confusing the C API's stack with the interpreter's runtime stack.  They're different animals :)

The stack exposed in the C API is basically just a mechanism for passing arguments to C functions -- that's the stack you're interacting with when you call lua_iscfunction.  In the context of the C-API's stack, functions don't have names.  They're just pointers.

Yes I know the difference, but I push a function to the stack first and then its arguments, but on the function push, I use a string name to get the function and I would like to get back this name from the stack item

Phil