Dumping Functions Sourcecode |
|
I have used Tcl for a while and I find the procedure "info body <procedures name>" quite handy and I long for it in Lua.
string.dump(<function)>) could be expanded to string.dump(<function>,<sourcecode?>)
and if <sourcecode> is not nil then return the function's source code.
Example:
function bla (n) print(n) end print(string.dump(bla,true))
would print:
function (n) print(n) end