Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
21
Task/Reflection-List-methods/Lua/reflection-list-methods.lua
Normal file
21
Task/Reflection-List-methods/Lua/reflection-list-methods.lua
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
function helloWorld()
|
||||
print "Hello World"
|
||||
end
|
||||
|
||||
-- Will list all functions in the given table, but does not recurse into nexted tables
|
||||
function printFunctions(t)
|
||||
local s={}
|
||||
local n=0
|
||||
for k in pairs(t) do
|
||||
n=n+1 s[n]=k
|
||||
end
|
||||
table.sort(s)
|
||||
for k,v in ipairs(s) do
|
||||
f = t[v]
|
||||
if type(f) == "function" then
|
||||
print(v)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
printFunctions(_G)
|
||||
Loading…
Add table
Add a link
Reference in a new issue