Zum Inhalt springen

Modul:TableTools: Unterschied zwischen den Versionen

better error message for the set functions
(only allow two or more arguments for the set functions)
(better error message for the set functions)
Zeile 93: Zeile 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 = {}, {}
Zeile 139: Zeile 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
Zeile 169: Zeile 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 = {}, {}, {}
Zeile 205: Zeile 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
Zeile 255: Zeile 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
--[[
--[[
Anonymer Benutzer