跳转到内容

模組:OutputBuffer

维基百科,自由的百科全书

这是Module:OutputBuffer当前版本,由WeiHsiang Wang留言 | 贡献编辑于2015年7月31日 (五) 16:55 建立内容为“return function() local buffer = {} return function(sep) local b = buffer buffer = {} return table.concat(b, sep) end, function(text) bu...”的新页面)。这个网址是本页该版本的固定链接。

(差异) ←上一修订 | 最后版本 (差异) | 下一修订→ (差异)
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