Module:table/isSubsetList
Itsura
- This module lacks a documentation subpage. Please create it.
- Useful links: root page • root page’s subpages • links • transclusions • testcases • sandbox
local table_list_to_set_module = "Module:table/listToSet"
local function list_to_set(...)
list_to_set = require(table_list_to_set_module)
return list_to_set(...)
end
--[==[
Returns true if the first list, taken as a set, is a subset of the second list, taken as a set.]==]
return function(t1, t2)
t2 = list_to_set(t2)
local i = 0
while true do
i = i + 1
local v = t1[i]
if v == nil then
return true
elseif t2[v] == nil then
return false
end
end
end