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

Jump to navigation Jump to search
Correction for unpack/table.unpack *** sovrascritto il testo esistente ***
m (Added groupBy)
(Correction for unpack/table.unpack *** sovrascritto il testo esistente ***)
end
 
 
--[[
 
Since lua5.2 unpack has been moved to table.unpack, this allows migration with
older versions on PCW.
 
--]]
table.unpack = table.unpack or unpack
 
--[[
Merges two tables into a new one. Integer indices of the second table will
follow the ones of the first. Other indices overwrite the ones of the first
in case of equlityequality, unless the values are tables in both the source tables:
in this case they are merged recursively.
 
local valueKeys = {table.deepSearch(v, value)}
if valueKeys[#valueKeys] then
return k, table.unpack(valueKeys)
end
end
 
local groups = {}
for k_, v in iter(tab) do
local groupID = getGroup(v)
if not groups[groupID] then
79 553

contributi

Menu di navigazione