Modul:TableTools: Unterschied zwischen den Versionen
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) |
||
Zeile 92: | Zeile 92: | ||
function p.union(...) | function p.union(...) | ||
local lim = select('#', ...) | local lim = select('#', ...) | ||
if lim | if lim < 2 then | ||
error(" | error(lim .. ' argument' .. (lim == 1 and '' or 's') .. " passed to 'union' (minimum is 2)", 2) | ||
end | end | ||
local ret, trackArrays = {}, {} | local ret, trackArrays = {}, {} | ||
Zeile 168: | Zeile 168: | ||
function p.intersection(...) | function p.intersection(...) | ||
local lim = select('#', ...) | local lim = select('#', ...) | ||
if lim | if lim < 2 then | ||
error(" | error(lim .. ' argument' .. (lim == 1 and '' or 's') .. " passed to 'intersection' (minimum is 2)", 2) | ||
end | end | ||
local ret, track, pairCounts = {}, {}, {} | local ret, track, pairCounts = {}, {}, {} | ||
Zeile 254: | Zeile 254: | ||
function p.complement(...) | function p.complement(...) | ||
local lim = select('#', ...) | local lim = select('#', ...) | ||
if lim | if lim < 2 then | ||
error( | error(lim .. ' argument' .. (lim == 1 and '' or 's') .. " passed to 'complement' (minimum is 2)", 2) | ||
end | end | ||
--[[ | --[[ |