Module:TableTools: Difference between revisions

only allow two or more arguments for the set functions
(add type-checking to removeDuplicates)
(only allow two or more arguments for the set functions)
Line 92:
function p.union(...)
local lim = select('#', ...)
if lim ==< 02 then
error("nolim arguments.. ' argument' .. (lim == 1 and '' or 's') .. " passed to 'union' (minimum is 2)", 2)
end
local ret, trackArrays = {}, {}
Line 168:
function p.intersection(...)
local lim = select('#', ...)
if lim ==< 02 then
error("nolim arguments.. ' argument' .. (lim == 1 and '' or 's') .. " passed to 'intersection' (minimum is 2)", 2)
end
local ret, track, pairCounts = {}, {}, {}
Line 254:
function p.complement(...)
local lim = select('#', ...)
if lim ==< 02 then
error("nolim arguments.. ' argument' .. (lim == 1 and '' or 's') .. " passed to 'complement' (minimum is two2)", 2)
elseif lim == 1 then
error("only one argument passed to 'complement' (minimum is two)", 2)
end
--[[
Anonymous user