function Functional.Take(a,Q,d)d=d or 1 local B=Q+(d-1)if B>#a then B=#a end local c={}for Q=d,B,1 do local B=a[Q]local i=Q-(d-1)c[i]=B end return c end
--[[
	Returns a list that contains at most `count` values from the given list.
]]
function Functional.Take(list, count, startingIndex)
	startingIndex = startingIndex or 1

	local maxIndex = count + (startingIndex - 1)
	if maxIndex > #list then
		maxIndex = #list
	end

	local new = {}

	for i = startingIndex, maxIndex do
		local value = list[i]
		local newIndex = i - (startingIndex - 1)
		new[newIndex] = value
	end

	return new
end
