Módulo:OutputBuffer

Revisão em 01h14min de 14 de maio de 2024 por Jaewoo (discussão | contribs) (Criou a página com "return function() local buffer = {} return function(sep) local b = buffer buffer = {} return table.concat(b, sep) end, function(text) buffer[#buffer + 1] = text end, function(...) buffer[#buffer + 1] = string.format(...) end end")
(dif) ← Revisão anterior | Revisão atual (dif) | Revisão seguinte → (dif)

A documentação para este módulo pode ser criada na página Módulo:OutputBuffer/doc

return function()
	local buffer = {}
	return function(sep)
		local b = buffer
		buffer = {}
		return table.concat(b, sep)
	end,
	function(text)
		buffer[#buffer + 1] = text
	end,
	function(...)
		buffer[#buffer + 1] = string.format(...)
	end
end