Anonymous

Module:FunList/Sandbox: Difference between revisions

From Melvor Idle
Add function to specify iterator used for iterating table
(Update ipairs/pairs override)
(Add function to specify iterator used for iterating table)
 
Line 145: Line 145:
function Enumerator3.create(obj)
function Enumerator3.create(obj)
     local func, current, index = getIterator(obj)
     local func, current, index = getIterator(obj)
    return Enumerator3.new(func, index, function() return current end)
end
function Enumerator3.createWith(obj, iterator)
    local func, current, index = iterator(obj)
     return Enumerator3.new(func, index, function() return current end)
     return Enumerator3.new(func, index, function() return current end)
end
end
2,875

edits