Module:OutputBuffer: Difference between revisions

From Our World of Text Wiki
Jump to navigation Jump to search
Dat Hack3r (talk | contribs)
Created module.
 
(No difference)

Latest revision as of 12:16, 12 April 2024

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