Archived

This topic is now archived and is closed to further replies.

lua function/var list

This topic is 5308 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

is there any (easy/fast) way to retrieve a list of all variables/functions set/registered in lua? (kinda like q3''s cvarlist) mfg Phreak -- "Input... need input!" - Johnny Five, Short Circuit.

Share this post


Link to post
Share on other sites
hmm thats gonna be the last option as i''m currently not deep enough into lua to do it right away! also if there is anything else out there (maybe even native (native lua)) there should be no need to reinvent the wheel.

hope its not too obvious that i_m lazy as can be...

mfg Phreak
--
"Input... need input!" - Johnny Five, Short Circuit.

Share this post


Link to post
Share on other sites
if you''re talking about functions that are assigned to global variables, just iterate through the global table, searching for values whose type is function.


How appropriate. You fight like a cow.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I might not be remembering correctly, but isn''t every variable on the stack?

Share this post


Link to post
Share on other sites
ap:
what do you mean by ''on the stack''?

as far as i understand it the stack in lua contains just what you want it to (correct me if i''m wrong):
call a function and the return vars will be on the stack
have a function called from lua and all the parameters will be on it

besides that there are some ''virtual'' indices for the lua registry or default variables (c_closures)


so it seems i''m gonna have to write that myself, but if anyone is interested i could post it back here when its finished...

(might be some time since it is currently low priority on my list, but if some people might need it, who knows )

mfg Phreak
--
"Input... need input!" - Johnny Five, Short Circuit.

Share this post


Link to post
Share on other sites