[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: function name
- From: "Brett Bibby" <research@...>
- Date: Fri, 5 Mar 2004 10:55:41 +0800
Ashwin,
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
end
And then...
function Fooey()
SetSomeValueInTheCHost(Foo)
end
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?
Thanks,
Brett
----- Original Message -----
From: "Ashwin Hirschi" <deery@operamail.com>
To: "Lua list" <lua@bazar2.conectiva.com.br>
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":
>
> http://www.lua.org/manual/5.0/manual.html#4
>
> Ashwin.
> --
> no signature is a signature