[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: is it possible to obtain registered functions list of a lua state?
- From: Michael Pruemm <mpruemm@...>
- Date: Mon, 16 Nov 2009 09:54:06 +0100
You could iterate over the table _G and all module tables in
package.loaded and look for entries with type 'function'. This is the
closest you can get to getting a list of (global) functions from Lua.
For a script editor, would also need to get names of local functions
and functions on objects. There is no way of getting the former unless
you parse the Lua code yourself and keep track of things.
There is also no way to get a function signature because Lua functions
do not declare how many arguments they take.
Syntactic sugar causes cancer of the semicolon. - Alan J. Perlis