Module:FunList: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 6: Line 6:
     assert(type(tbl) == 'table')
     assert(type(tbl) == 'table')
     assert(tbl ~= nil)
     assert(tbl ~= nil)
   
 
     local self = setmetatable({}, funlist)
     local self = setmetatable({}, funlist)
self.mytable = tbl
self.mytable = tbl
Line 18: Line 18:
local i = 0
local i = 0
if ix >= 0 then
if ix >= 0 then
for _, v in pairs(mytable) do
for _, v in pairs(self.mytable) do
i = i + 1
i = i + 1
if i == ix then
if i == ix then
2,875

edits