יחידה: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
--[[
--[[