local A=script.Parent local Z=A.Parent local T=require(Z.t)local j=T.tuple(T.table,T.integer)local function o(A,Z,T)assert(j(A,Z))local o=#A if Z<0 then Z=o+Z end assert(Z>0 and Z<=o+1,string.format("\105\110\100\101\120 \037\100 \111\117\116 \111\102 \098\111\117\110\100\115 \111\102 \108\105\115\116 \111\102 \108\101\110\103\116\104 \037\100",Z,o))local W={}local g=1 for j=1,o,1 do if j==Z then W[g]=T else W[g]=A[j]end g+=1 end return W end return o
local List = script.Parent

local Llama = List.Parent
local t = require(Llama.t)

local validate = t.tuple(t.table, t.integer)

local function set(list, index, value)
	assert(validate(list, index))
	
	local len = #list

	if index < 0 then
		index = len + index
	end

	assert(index > 0 and index <= len + 1, string.format("index %d out of bounds of list of length %d", index, len))

	local new = {}
	local indexNew = 1

	for i = 1, len do
		if i == index then
			new[indexNew] = value
		else
			new[indexNew] = list[i]
		end

		indexNew += 1
	end

	return new
end

return set