🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

lua function/var list

Started by
4 comments, last by LousyPhreak 21 years ago
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.
http://mitglied.lycos.de/lousyphreak/
Advertisement
you could write one
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.
http://mitglied.lycos.de/lousyphreak/
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.
I might not be remembering correctly, but isn''t every variable on the stack?
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.
http://mitglied.lycos.de/lousyphreak/

This topic is closed to new replies.

Advertisement