"ماڈیول:TableTools" کے نسخوں کے درمیان فرق

only allow two or more arguments for the set functions
better error message for the set functions
سطر 93: سطر 93:
local lim = select('#', ...)  
local lim = select('#', ...)  
if lim < 2 then
if lim < 2 then
error(lim .. ' argument' .. (lim == 1 and '' or 's') .. " passed to 'union' (minimum is 2)", 2)
error("too few arguments to 'union' (minimum is 2, received " .. lim .. ')', 2)
end
end
local ret, trackArrays = {}, {}
local ret, trackArrays = {}, {}
سطر 139: سطر 139:
local lim = select('#', ...)  
local lim = select('#', ...)  
if lim < 2 then
if lim < 2 then
error(lim .. ' argument' .. (lim == 1 and '' or 's') .. " passed to 'valueUnion' (minimum is 2)", 2)
error("too few arguments to 'valueUnion' (minimum is 2, received " .. lim .. ')', 2)
end
end
local isNan = p.isNan
local isNan = p.isNan
سطر 169: سطر 169:
local lim = select('#', ...)  
local lim = select('#', ...)  
if lim < 2 then
if lim < 2 then
error(lim .. ' argument' .. (lim == 1 and '' or 's') .. " passed to 'intersection' (minimum is 2)", 2)
error("too few arguments to 'intersection' (minimum is 2, received " .. lim .. ')', 2)
end
end
local ret, track, pairCounts = {}, {}, {}
local ret, track, pairCounts = {}, {}, {}
سطر 205: سطر 205:
local lim = select('#', ...)  
local lim = select('#', ...)  
if lim < 2 then
if lim < 2 then
error(lim .. ' argument' .. (lim == 1 and '' or 's') .. " passed to 'valueIntersection' (minimum is 2)", 2)
error("too few arguments to 'valueIntersection' (minimum is 2, received " .. lim .. ')', 2)
end
end
local isNan = p.isNan
local isNan = p.isNan
سطر 255: سطر 255:
local lim = select('#', ...)  
local lim = select('#', ...)  
if lim < 2 then
if lim < 2 then
error(lim .. ' argument' .. (lim == 1 and '' or 's') .. " passed to 'complement' (minimum is 2)", 2)
error("too few arguments to 'complement' (minimum is 2, received " .. lim .. ')', 2)
end
end
--[[
--[[