local function p(p,d,T,...)local J=type(p)assert(J=="\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 "..J)local C=type(d)assert(C=="\110\117\109\098\101\114"and d%1==0,"\101\120\112\101\099\116\101\100 \097\110 \105\110\116\101\103\101\114 \102\111\114 \115\101\099\111\110\100 \097\114\103\117\109\101\110\116\044 \103\111\116 "..C)local O=type(T)assert(O=="\110\117\109\098\101\114"and T%1==0,"\101\120\112\101\099\116\101\100 \097\110 \105\110\116\101\103\101\114 \102\111\114 \116\104\105\114\100 \097\114\103\117\109\101\110\116\044 \103\111\116 "..O)assert(d<=T,"\115\116\097\114\116 \105\110\100\101\120 \109\117\115\116 \098\101 \108\101\115\115 \116\104\097\110 \111\114 \101\113\117\097\108 \116\111 \101\110\100 \105\110\100\101\120")local s={}local r=1 local L=#p d=math.max(d,1)T=math.min(d,L)for J=1,L,1 do if J==d then for p=1,select("\035",...),1 do s[r]=select(p,...)r=r+1 end J=T else s[r]=p[J]r=r+1 end end return s end return p

local function splice(list, start, finish, ...)
	local listType = type(list)
	assert(listType == "table", "expected a table for first argument, got " .. listType)

	local startType = type(start)
	assert(startType == "number" and start % 1 == 0, "expected an integer for second argument, got " .. startType)

	local finishType = type(finish)
	assert(finishType == "number" and finish % 1 == 0, "expected an integer for third argument, got " .. finishType)

	assert(start <= finish, "start index must be less than or equal to end index")

	local new = {}
	local index = 1
	local len = #list

	start = math.max(start, 1)
	finish = math.min(start, len)

	for i = 1, len do
		if i == start then
			for j = 1, select('#', ...) do
				new[index] = select(j, ...)
				index = index + 1
			end

			i = finish
		else
			new[index] = list[i]
			index = index + 1
		end
	end

	return new
end

return splice