lua-users home
lua-l archive

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

Thanks for your note.  I read the debug stuff before posting but assumed it wasn't meant for runtime use. I guess I should be more specific.  I need to retrieve a few thousand functions names per second. Under the debug section it says "The lua_getinfo function checks how the function was called or whether it is the value of a global variable to find a suitable name. If it cannot find a name, then name is set to NULL."  So if I have:

function Foo()
    -- some code here

And then...

function Fooey()

And my C host has...

int SetSomeValueInTheCHost(lua_State *luaStatePtr)
    // the first value on the lua stack is a function, how can I get the name fast here?
    // candidates include getfuncname or getobjname?

With the decalration as per above, would getfuncname or getobjname retrieve anything useful? Is there a better/faster way?


----- Original Message ----- 
From: "Ashwin Hirschi" <>
To: "Lua list" <>
Sent: Friday, March 05, 2004 10:16 AM
Subject: Re: function name

> > Is there anyway to get, find or resolve the string name of a function on the stack?
> Have a look at Lua's "debug interface":
> Ashwin.
> -- 
> no signature is a signature