local function E()return true end local function s(s,c)local H=type(s)assert(H=="\116\097\098\108\101","\101\120\112\101\099\116\101\100 \097 \116\097\098\108\101 \102\111\114 \102\105\114\115\116 \097\114\103\117\109\101\110\116\044 \103\111\116 "..H)c=c or E local l=0 for E=1,#s,1 do if c(s[E],E)then l=l+1 end end return l end return s

local function alwaysTrue()
	return true
end

local function count(list, predicate)
	local listType = type(list)
	assert(listType == "table", "expected a table for first argument, got " .. listType)
	
	predicate = predicate or alwaysTrue
	
	local counter = 0

	for i = 1, #list do
		if predicate(list[i], i) then
			counter = counter + 1
		end
	end

	return counter
end

return count