Module:OutputBuffer

Safer nicotine wiki Tobacco Harm Reduction
Revision as of 14:22, 11 December 2020 by Richardpruen (talk | contribs) (1 revision imported: Wikipedia article on Nicotine modules needed)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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