>>45
dat currying. It takes creativity to come up with something like that.
here's what I do:
-- inside of anus.lua
local Haxable = require'Haxable'
local oo = require'oo'
local Anus = {}
function Anus:init()
print "hax my anus"
end
-- I don't have destructors.. :destroy(function (self) print(self.haxed and "haxed" or "not haxed") end)
function Anus:hax()
self.haxed = true
end
function Anus:shit()
collectgarbage()
end
oo.class(Anus, {Haxable})
return Anus
class "Anus" ("Haxable")
:init(function (self) print "hax my anus" end)
:destroy(function (self) print(self.haxed and "haxed" or "not haxed") end)
:method "hax" (function (self) self.haxed = true end)
:method "shit" (function (self) collectgarbage() end)