Differenze tra le versioni di "Modulo:Wikilib/tables"

Adding space above MTCompatto *** sovrascritto il testo esistente ***
(Updating some table functions to work better with mw.loaddata, and using them in various DebRes *** sovrascritto il testo esistente ***)
(Adding space above MTCompatto *** sovrascritto il testo esistente ***)
 
local function isint(val)
return type(val) == "number" and val == math.floor(val)
end
 
-- Stateless iterator on non-integer keys
local function nextNonInt(tab, key)
local nextKey, nextValue = key, nil
repeat
nextKey, nextValue = next(tab, nextKey)
until not isint(nextKey)
return nextKey, nextValue
end
 
table.insert(dest, value)
end
for key, value in table.nonIntPairspairs(tab2) do
if not isint(key) then
dest[key]if
and type( dest[key]) == "table"
and type(valuedest[key]) == "table"
and type(value) == "table"
then
dest[key] = table.deepMerge(dest[key], value)then
dest[key] = table.deepMerge(dest[key], value)
else
dest[key] = valueelse
dest[key] = value
then end
end
end
end
t.merge = table.merge
 
-- Stateless iterator to be used in for loops
---@deprecated
table.nonIntPairs = function(tab)
return nextNonInt, tab
end
 
-- Predicate search. Returns the index of any value satisfying the predicate,
end
end
-- No explicit return, thus nil
end
t.search = table.search
end
 
for key, value in table.nonIntPairspairs(tab) do
until if not isint(nextKeykey) then
-- If value is not in check, minor returns true, as the second argument
-- is nil
if minor(key, check[value]) then -- is nil
if minor(key, check[value]) = keythen
check[value] = key
else end
end
end
79 553

contributi