ShayF2 Posted October 10, 2018 Share Posted October 10, 2018 (edited) function getAllFunctions() local funcs = {} local function dump(t) for k, v in pairs(t) do --[[if type(v) == 'table' then dump(v) else]]if type(v) == 'function' then funcs[k] = v end end end dump(_G) print('hi') return funcs end function getFunctionFromName(name) local t = getAllFunctions()-- first run here if type(name) == 'string' then if t[name] then return t[name] end end return false end local GAF = getFunctionFromName('getAllFunctions') GAF()-- second run here. I'm trying to do stuff like this for string modification, loading external (not included) files, and other crazy stuff, this is really just for test purposes. Stack Overflow error occurs when repeating the same action to child tables. Does anyone have a way around this? Edited October 10, 2018 by ShayF Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now