Difference between revisions of "Module:TableTools"

Jump to navigation Jump to search
80 bytes removed ,  01:17, 20 December 2013
better error message for the set functions
>Mr. Stradivarius
(only allow two or more arguments for the set functions)
>Mr. Stradivarius
(better error message for the set functions)
Line 93: Line 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 = {}, {}
Line 139: Line 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
Line 169: Line 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 = {}, {}, {}
Line 205: Line 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
Line 255: Line 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
--[[
--[[
Anonymous user

Navigation menu