Changes

Jump to: navigation, search

Module:Arguments

7 bytes removed, 21:40, 12 January 2014
m
tweak one of the comments and make some beautification fixes, now that this is in the job queue
local function mergeArgs(iterator, tables)
-- Accepts multiple tables as input and merges their keys and values into one table using the specified iterator.
-- If a value is already present it is not overwritten; tables listed earlier have precendenceprecedence.
-- We are also memoizing nil values, but those values can be overwritten.
for _, t in ipairs(tables) do
metatable.doneIpairs = true
end
return function ( t, k ) local nk, val = next( metaArgs, k )
if val == nilArg then
val = nil
metatable.doneIpairs = true
end
return function ( t, i )
local val = metaArgs[i + 1]
if val == nil then
Anonymous user

Navigation menu