Module:OutputBuffer: Difference between revisions

From Saintapedia
Jump to navigation Jump to search
>Tomoneill
(copy from https://en.wikipedia.org/w/index.php?title=Module:OutputBuffer&oldid=695184564)
(No difference)

Revision as of 15:02, 13 March 2019

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