I am going to amend my response on further thought. If (and only if) your function has a name associated with it (i.e. not anonymous) and that name is accessible to you (e.g. it is a global variable), you may be able to retrieve the reference to the function by the string name.
For example:
foo = function() print(‘hello’) end
Assuming foo is a global variable, global variables are actually just stored in a table called _G.
So you can get back the function via.
local my_func = _G[“foo”]
my_func() – prints hello
But I stand by my original response that it is much better to just save the reference to the function directly instead of the name.
[import]uid: 7563 topic_id: 9658 reply_id: 35343[/import]