function MaidClass.Mark(l,X)local x=typeof(X)if DESTRUCTORS[x]then l.Trash[X]=x else error(FORMAT_STR:format(x),2)end end function MaidClass.Unmark(l,X)if X then l.Trash[X]=nil else l.Trash={}end end function MaidClass.Sweep(X)for X,l in pairs(X.Trash)do DESTRUCTORS[l](X)end X.Trash={}end MaidClass.Destroy=MaidClass.Sweep MaidClass.mark=MaidClass.Mark MaidClass.unmark=MaidClass.Unmark MaidClass.sweep=MaidClass.Sweep MaidClass.destroy=MaidClass.Sweep


function MaidClass:Mark(item)
	local tof = typeof(item)
	
	if DESTRUCTORS[tof] then
		self.Trash[item] = tof
	else
		error(FORMAT_STR:format(tof), 2)
	end
end

function MaidClass:Unmark(item)
	if item then
		self.Trash[item] = nil
	else
		self.Trash = {}
	end
end

function MaidClass:Sweep()
	for item, tof in pairs(self.Trash) do
		DESTRUCTORS[tof](item)
	end
	self.Trash = {}
end

MaidClass.Destroy = MaidClass.Sweep

MaidClass.mark = MaidClass.Mark
MaidClass.unmark = MaidClass.Unmark
MaidClass.sweep = MaidClass.Sweep
MaidClass.destroy = MaidClass.Sweep
