Khác biệt giữa các bản “Mô đun:OutputBuffer”
(Tạo trang mới với nội dung “return function() local buffer = {} return function(sep) local b = buffer buffer = {} return table.concat(b, sep) end, function(text) buffer[#…”)
 
(Không có sự khác biệt)

Bản hiện tại lúc 22:07, ngày 24 tháng 10 năm 2020

Có thể viết tài liệu về mô đun này tại Mô đun:OutputBuffer/tài liệu.

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