Jump to content

Module:table/isSubsetList

Wiktionary වෙතින්


local table_list_to_set_module = "Module:table/listToSet"

local pairs = pairs

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)
	for _, v in pairs(t1) do
		if t2[v] == nil then
			return false
		end
	end
	return true
end
"https://si.wiktionary.org/w/index.php?title=Module:table/isSubsetList&oldid=221474" වෙතින් සම්ප්‍රවේශනය කෙරිණි