lua-users home
lua-l archive

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


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

Hrm.  Well, if you push the function via lua_getglobal, then you're pushing it to the C stack -- so you don't want to use lua_getinfo() to get its name back -- lua_getinfo() references the runtime stack.  Instead, you'll need to traverse the global table to find the function's key string.  This is slow, but possible, provided that there's not more than one global name associated with the function.

-Sven