Module:OutputBuffer: Difference between revisions
From Zoophilia Wiki
Jump to navigationJump to search
meta>Jackmcbarn ←Created page with 'return function() local buffer = {} return function(text) buffer[#buffer + 1] = text end, function(sep) return table.concat(buffer, sep) end end' |
meta>Jackmcbarn clear buffer after using |
||
| Line 5: | Line 5: | ||
end, | end, | ||
function(sep) | function(sep) | ||
local b = buffer | |||
buffer = nil | |||
return table.concat(buffer, sep) | return table.concat(buffer, sep) | ||
end | end | ||
end | end | ||
Revision as of 23:46, 25 June 2014
Documentation for this module may be created at Module:OutputBuffer/doc
return function()
local buffer = {}
return function(text)
buffer[#buffer + 1] = text
end,
function(sep)
local b = buffer
buffer = nil
return table.concat(buffer, sep)
end
end