Module:Sandbox/Erutuon/random
< Module:Sandbox | Erutuon
Jump to navigation
Jump to search
Revision as of 21:58, 26 May 2018 by blackwiki>Erutuon (convenient output class)
Test
- hello
local p = {}
local Out_mt = {}
Out_mt.__index = Out_mt
function Out_mt:add(item)
self.i = self.i + 1
self[self.i] = item
end
function Out_mt:__tostring()
return table.concat(self)
end
function Out()
local o = setmetatable({}, Out_mt)
o.i = 0
return o
end
function p.show(frame)
local out = Out()
out:add('hello')
return out
end
return p