Módulo:OutputBuffer

Revisión del 01:12 26 abr 2023 de Pyc1948 (discusión | contribs.) (Página creada con «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»)
(difs.) ← Revisión anterior | Revisión actual (difs.) | Revisión siguiente → (difs.)

Uso


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