Jump to content

Module:OutputBuffer

From Simple English Wikipedia, the free encyclopedia
Revision as of 00:06, 26 June 2014 by Jackmcbarn (talk | changes) (change output order and fix bug)

Documentation for this module may be created at Module: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