2011-06-19 19:07:01 +00:00
|
|
|
local Hello
|
2011-10-02 05:20:29 +00:00
|
|
|
Hello = (function()
|
|
|
|
local _parent_0 = nil
|
2011-07-14 07:02:07 +00:00
|
|
|
local _base_0 = {
|
|
|
|
hello = function(self)
|
|
|
|
return print(self.test, self.world)
|
|
|
|
end,
|
|
|
|
__tostring = function(self)
|
|
|
|
return "hello world"
|
|
|
|
end
|
|
|
|
}
|
2011-06-15 15:52:01 +00:00
|
|
|
_base_0.__index = _base_0
|
2011-07-14 07:02:07 +00:00
|
|
|
if _parent_0 then
|
2011-12-04 03:17:06 +00:00
|
|
|
setmetatable(_base_0, _parent_0.__base)
|
2011-07-14 07:02:07 +00:00
|
|
|
end
|
|
|
|
local _class_0 = setmetatable({
|
|
|
|
__init = function(self, test, world)
|
2011-06-15 15:52:01 +00:00
|
|
|
self.test, self.world = test, world
|
|
|
|
return print("creating object..")
|
2011-12-04 03:17:06 +00:00
|
|
|
end,
|
|
|
|
__base = _base_0,
|
|
|
|
__name = "Hello",
|
|
|
|
__parent = _parent_0
|
2011-07-14 07:02:07 +00:00
|
|
|
}, {
|
2011-12-04 03:17:06 +00:00
|
|
|
__index = function(cls, name)
|
|
|
|
local val = rawget(_base_0, name)
|
|
|
|
if val == nil and _parent_0 then
|
|
|
|
return _parent_0[name]
|
|
|
|
else
|
|
|
|
return val
|
|
|
|
end
|
|
|
|
end,
|
2011-10-02 05:20:29 +00:00
|
|
|
__call = function(cls, ...)
|
|
|
|
local _self_0 = setmetatable({}, _base_0)
|
|
|
|
cls.__init(_self_0, ...)
|
|
|
|
return _self_0
|
2011-07-14 07:02:07 +00:00
|
|
|
end
|
|
|
|
})
|
2011-07-04 18:36:26 +00:00
|
|
|
_base_0.__class = _class_0
|
|
|
|
return _class_0
|
2011-06-15 15:52:01 +00:00
|
|
|
end)()
|
2011-06-15 06:13:33 +00:00
|
|
|
local x = Hello(1, 2)
|
|
|
|
x:hello()
|
2011-06-16 05:41:17 +00:00
|
|
|
print(x)
|
2011-06-19 19:07:01 +00:00
|
|
|
local Simple
|
2011-10-02 05:20:29 +00:00
|
|
|
Simple = (function()
|
|
|
|
local _parent_0 = nil
|
2011-07-14 07:02:07 +00:00
|
|
|
local _base_0 = {
|
|
|
|
cool = function(self)
|
|
|
|
return print("cool")
|
|
|
|
end
|
|
|
|
}
|
2011-06-16 05:41:17 +00:00
|
|
|
_base_0.__index = _base_0
|
2011-07-14 07:02:07 +00:00
|
|
|
if _parent_0 then
|
2011-12-04 03:17:06 +00:00
|
|
|
setmetatable(_base_0, _parent_0.__base)
|
2011-07-14 07:02:07 +00:00
|
|
|
end
|
|
|
|
local _class_0 = setmetatable({
|
|
|
|
__init = function(self, ...)
|
2011-06-19 19:07:01 +00:00
|
|
|
if _parent_0 then
|
|
|
|
return _parent_0.__init(self, ...)
|
|
|
|
end
|
2011-12-04 03:17:06 +00:00
|
|
|
end,
|
|
|
|
__base = _base_0,
|
|
|
|
__name = "Simple",
|
|
|
|
__parent = _parent_0
|
2011-07-14 07:02:07 +00:00
|
|
|
}, {
|
2011-12-04 03:17:06 +00:00
|
|
|
__index = function(cls, name)
|
|
|
|
local val = rawget(_base_0, name)
|
|
|
|
if val == nil and _parent_0 then
|
|
|
|
return _parent_0[name]
|
|
|
|
else
|
|
|
|
return val
|
|
|
|
end
|
|
|
|
end,
|
2011-10-02 05:20:29 +00:00
|
|
|
__call = function(cls, ...)
|
|
|
|
local _self_0 = setmetatable({}, _base_0)
|
|
|
|
cls.__init(_self_0, ...)
|
|
|
|
return _self_0
|
2011-07-14 07:02:07 +00:00
|
|
|
end
|
|
|
|
})
|
2011-07-04 18:36:26 +00:00
|
|
|
_base_0.__class = _class_0
|
|
|
|
return _class_0
|
2011-06-16 05:41:17 +00:00
|
|
|
end)()
|
2011-06-19 19:07:01 +00:00
|
|
|
local Yikes
|
2011-10-02 05:20:29 +00:00
|
|
|
Yikes = (function()
|
|
|
|
local _parent_0 = Simple
|
2011-07-14 07:02:07 +00:00
|
|
|
local _base_0 = { }
|
2011-06-16 05:41:17 +00:00
|
|
|
_base_0.__index = _base_0
|
|
|
|
if _parent_0 then
|
2011-12-04 03:17:06 +00:00
|
|
|
setmetatable(_base_0, _parent_0.__base)
|
2011-06-16 05:41:17 +00:00
|
|
|
end
|
2011-07-14 07:02:07 +00:00
|
|
|
local _class_0 = setmetatable({
|
|
|
|
__init = function(self)
|
|
|
|
return print("created hello")
|
2011-12-04 03:17:06 +00:00
|
|
|
end,
|
|
|
|
__base = _base_0,
|
|
|
|
__name = "Yikes",
|
|
|
|
__parent = _parent_0
|
2011-07-14 07:02:07 +00:00
|
|
|
}, {
|
2011-12-04 03:17:06 +00:00
|
|
|
__index = function(cls, name)
|
|
|
|
local val = rawget(_base_0, name)
|
|
|
|
if val == nil and _parent_0 then
|
|
|
|
return _parent_0[name]
|
|
|
|
else
|
|
|
|
return val
|
|
|
|
end
|
|
|
|
end,
|
2011-10-02 05:20:29 +00:00
|
|
|
__call = function(cls, ...)
|
|
|
|
local _self_0 = setmetatable({}, _base_0)
|
|
|
|
cls.__init(_self_0, ...)
|
|
|
|
return _self_0
|
2011-07-14 07:02:07 +00:00
|
|
|
end
|
|
|
|
})
|
2011-07-04 18:36:26 +00:00
|
|
|
_base_0.__class = _class_0
|
|
|
|
return _class_0
|
2011-10-02 05:20:29 +00:00
|
|
|
end)()
|
2011-06-16 05:41:17 +00:00
|
|
|
x = Yikes()
|
2011-06-19 19:07:01 +00:00
|
|
|
x:cool()
|
|
|
|
local Hi
|
2011-10-02 05:20:29 +00:00
|
|
|
Hi = (function()
|
|
|
|
local _parent_0 = nil
|
2011-07-14 07:02:07 +00:00
|
|
|
local _base_0 = {
|
|
|
|
cool = function(self, num)
|
|
|
|
return print("num", num)
|
|
|
|
end
|
|
|
|
}
|
2011-06-19 19:07:01 +00:00
|
|
|
_base_0.__index = _base_0
|
2011-07-14 07:02:07 +00:00
|
|
|
if _parent_0 then
|
2011-12-04 03:17:06 +00:00
|
|
|
setmetatable(_base_0, _parent_0.__base)
|
2011-07-14 07:02:07 +00:00
|
|
|
end
|
|
|
|
local _class_0 = setmetatable({
|
|
|
|
__init = function(self, arg)
|
|
|
|
return print("init arg", arg)
|
2011-12-04 03:17:06 +00:00
|
|
|
end,
|
|
|
|
__base = _base_0,
|
|
|
|
__name = "Hi",
|
|
|
|
__parent = _parent_0
|
2011-07-14 07:02:07 +00:00
|
|
|
}, {
|
2011-12-04 03:17:06 +00:00
|
|
|
__index = function(cls, name)
|
|
|
|
local val = rawget(_base_0, name)
|
|
|
|
if val == nil and _parent_0 then
|
|
|
|
return _parent_0[name]
|
|
|
|
else
|
|
|
|
return val
|
|
|
|
end
|
|
|
|
end,
|
2011-10-02 05:20:29 +00:00
|
|
|
__call = function(cls, ...)
|
|
|
|
local _self_0 = setmetatable({}, _base_0)
|
|
|
|
cls.__init(_self_0, ...)
|
|
|
|
return _self_0
|
2011-07-14 07:02:07 +00:00
|
|
|
end
|
|
|
|
})
|
2011-07-04 18:36:26 +00:00
|
|
|
_base_0.__class = _class_0
|
|
|
|
return _class_0
|
2011-06-19 19:07:01 +00:00
|
|
|
end)()
|
2011-10-02 05:20:29 +00:00
|
|
|
Simple = (function()
|
|
|
|
local _parent_0 = Hi
|
2011-07-14 07:02:07 +00:00
|
|
|
local _base_0 = {
|
|
|
|
cool = function(self)
|
|
|
|
return _parent_0.cool(self, 120302)
|
|
|
|
end
|
|
|
|
}
|
2011-06-19 19:07:01 +00:00
|
|
|
_base_0.__index = _base_0
|
|
|
|
if _parent_0 then
|
2011-12-04 03:17:06 +00:00
|
|
|
setmetatable(_base_0, _parent_0.__base)
|
2011-06-19 19:07:01 +00:00
|
|
|
end
|
2011-07-14 07:02:07 +00:00
|
|
|
local _class_0 = setmetatable({
|
|
|
|
__init = function(self)
|
|
|
|
return _parent_0.__init(self, "man")
|
2011-12-04 03:17:06 +00:00
|
|
|
end,
|
|
|
|
__base = _base_0,
|
|
|
|
__name = "Simple",
|
|
|
|
__parent = _parent_0
|
2011-07-14 07:02:07 +00:00
|
|
|
}, {
|
2011-12-04 03:17:06 +00:00
|
|
|
__index = function(cls, name)
|
|
|
|
local val = rawget(_base_0, name)
|
|
|
|
if val == nil and _parent_0 then
|
|
|
|
return _parent_0[name]
|
|
|
|
else
|
|
|
|
return val
|
|
|
|
end
|
|
|
|
end,
|
2011-10-02 05:20:29 +00:00
|
|
|
__call = function(cls, ...)
|
|
|
|
local _self_0 = setmetatable({}, _base_0)
|
|
|
|
cls.__init(_self_0, ...)
|
|
|
|
return _self_0
|
2011-07-14 07:02:07 +00:00
|
|
|
end
|
|
|
|
})
|
2011-07-04 18:36:26 +00:00
|
|
|
_base_0.__class = _class_0
|
|
|
|
return _class_0
|
2011-10-02 05:20:29 +00:00
|
|
|
end)()
|
2011-06-19 19:07:01 +00:00
|
|
|
x = Simple()
|
2011-07-04 18:36:26 +00:00
|
|
|
x:cool()
|
2011-08-29 06:19:48 +00:00
|
|
|
print(x.__class == Simple)
|
|
|
|
local Okay
|
2011-10-02 05:20:29 +00:00
|
|
|
Okay = (function()
|
|
|
|
local _parent_0 = nil
|
2011-08-29 06:19:48 +00:00
|
|
|
local _base_0 = {
|
|
|
|
something = 20323
|
|
|
|
}
|
|
|
|
_base_0.__index = _base_0
|
|
|
|
if _parent_0 then
|
2011-12-04 03:17:06 +00:00
|
|
|
setmetatable(_base_0, _parent_0.__base)
|
2011-08-29 06:19:48 +00:00
|
|
|
end
|
|
|
|
local _class_0 = setmetatable({
|
|
|
|
__init = function(self, ...)
|
|
|
|
if _parent_0 then
|
|
|
|
return _parent_0.__init(self, ...)
|
|
|
|
end
|
2011-12-04 03:17:06 +00:00
|
|
|
end,
|
|
|
|
__base = _base_0,
|
|
|
|
__name = "Okay",
|
|
|
|
__parent = _parent_0
|
2011-08-29 06:19:48 +00:00
|
|
|
}, {
|
2011-12-04 03:17:06 +00:00
|
|
|
__index = function(cls, name)
|
|
|
|
local val = rawget(_base_0, name)
|
|
|
|
if val == nil and _parent_0 then
|
|
|
|
return _parent_0[name]
|
|
|
|
else
|
|
|
|
return val
|
|
|
|
end
|
|
|
|
end,
|
2011-10-02 05:20:29 +00:00
|
|
|
__call = function(cls, ...)
|
|
|
|
local _self_0 = setmetatable({}, _base_0)
|
|
|
|
cls.__init(_self_0, ...)
|
|
|
|
return _self_0
|
2011-08-29 06:19:48 +00:00
|
|
|
end
|
|
|
|
})
|
|
|
|
_base_0.__class = _class_0
|
|
|
|
return _class_0
|
2011-12-03 04:07:42 +00:00
|
|
|
end)()
|
|
|
|
local Biggie
|
|
|
|
Biggie = (function()
|
|
|
|
local _parent_0 = Okay
|
|
|
|
local _base_0 = {
|
|
|
|
something = function(self)
|
|
|
|
_parent_0.something(self, 1, 2, 3, 4)
|
|
|
|
_parent_0.something(another_self, 1, 2, 3, 4)
|
|
|
|
return assert(_parent_0 == Okay)
|
|
|
|
end
|
|
|
|
}
|
|
|
|
_base_0.__index = _base_0
|
|
|
|
if _parent_0 then
|
2011-12-04 03:17:06 +00:00
|
|
|
setmetatable(_base_0, _parent_0.__base)
|
2011-12-03 04:07:42 +00:00
|
|
|
end
|
|
|
|
local _class_0 = setmetatable({
|
|
|
|
__init = function(self, ...)
|
|
|
|
if _parent_0 then
|
|
|
|
return _parent_0.__init(self, ...)
|
|
|
|
end
|
2011-12-04 03:17:06 +00:00
|
|
|
end,
|
|
|
|
__base = _base_0,
|
|
|
|
__name = "Biggie",
|
|
|
|
__parent = _parent_0
|
2011-12-03 04:07:42 +00:00
|
|
|
}, {
|
2011-12-04 03:17:06 +00:00
|
|
|
__index = function(cls, name)
|
|
|
|
local val = rawget(_base_0, name)
|
|
|
|
if val == nil and _parent_0 then
|
|
|
|
return _parent_0[name]
|
|
|
|
else
|
|
|
|
return val
|
|
|
|
end
|
|
|
|
end,
|
2011-12-03 04:07:42 +00:00
|
|
|
__call = function(cls, ...)
|
|
|
|
local _self_0 = setmetatable({}, _base_0)
|
|
|
|
cls.__init(_self_0, ...)
|
|
|
|
return _self_0
|
|
|
|
end
|
|
|
|
})
|
|
|
|
_base_0.__class = _class_0
|
|
|
|
return _class_0
|
2011-12-03 04:37:47 +00:00
|
|
|
end)()
|
|
|
|
local Yeah
|
|
|
|
Yeah = (function()
|
|
|
|
local _parent_0 = nil
|
|
|
|
local _base_0 = {
|
|
|
|
okay = function(self)
|
|
|
|
return _parent_0.something(self, 1, 2, 3, 4)
|
|
|
|
end
|
|
|
|
}
|
|
|
|
_base_0.__index = _base_0
|
|
|
|
if _parent_0 then
|
2011-12-04 03:17:06 +00:00
|
|
|
setmetatable(_base_0, _parent_0.__base)
|
2011-12-03 04:37:47 +00:00
|
|
|
end
|
|
|
|
local _class_0 = setmetatable({
|
|
|
|
__init = function(self, ...)
|
|
|
|
if _parent_0 then
|
|
|
|
return _parent_0.__init(self, ...)
|
|
|
|
end
|
2011-12-04 03:17:06 +00:00
|
|
|
end,
|
|
|
|
__base = _base_0,
|
|
|
|
__name = "Yeah",
|
|
|
|
__parent = _parent_0
|
2011-12-03 04:37:47 +00:00
|
|
|
}, {
|
2011-12-04 03:17:06 +00:00
|
|
|
__index = function(cls, name)
|
|
|
|
local val = rawget(_base_0, name)
|
|
|
|
if val == nil and _parent_0 then
|
|
|
|
return _parent_0[name]
|
|
|
|
else
|
|
|
|
return val
|
|
|
|
end
|
|
|
|
end,
|
2011-12-03 04:37:47 +00:00
|
|
|
__call = function(cls, ...)
|
|
|
|
local _self_0 = setmetatable({}, _base_0)
|
|
|
|
cls.__init(_self_0, ...)
|
|
|
|
return _self_0
|
|
|
|
end
|
|
|
|
})
|
|
|
|
_base_0.__class = _class_0
|
|
|
|
return _class_0
|
2011-12-03 18:39:03 +00:00
|
|
|
end)()
|
|
|
|
local What
|
|
|
|
What = (function()
|
|
|
|
local _parent_0 = nil
|
|
|
|
local _base_0 = {
|
|
|
|
something = function(self)
|
|
|
|
return print("val:", self.val)
|
|
|
|
end
|
|
|
|
}
|
|
|
|
_base_0.__index = _base_0
|
|
|
|
if _parent_0 then
|
2011-12-04 03:17:06 +00:00
|
|
|
setmetatable(_base_0, _parent_0.__base)
|
2011-12-03 18:39:03 +00:00
|
|
|
end
|
|
|
|
local _class_0 = setmetatable({
|
|
|
|
__init = function(self, ...)
|
|
|
|
if _parent_0 then
|
|
|
|
return _parent_0.__init(self, ...)
|
|
|
|
end
|
2011-12-04 03:17:06 +00:00
|
|
|
end,
|
|
|
|
__base = _base_0,
|
|
|
|
__name = "What",
|
|
|
|
__parent = _parent_0
|
2011-12-03 18:39:03 +00:00
|
|
|
}, {
|
2011-12-04 03:17:06 +00:00
|
|
|
__index = function(cls, name)
|
|
|
|
local val = rawget(_base_0, name)
|
|
|
|
if val == nil and _parent_0 then
|
|
|
|
return _parent_0[name]
|
|
|
|
else
|
|
|
|
return val
|
|
|
|
end
|
|
|
|
end,
|
2011-12-03 18:39:03 +00:00
|
|
|
__call = function(cls, ...)
|
|
|
|
local _self_0 = setmetatable({}, _base_0)
|
|
|
|
cls.__init(_self_0, ...)
|
|
|
|
return _self_0
|
|
|
|
end
|
|
|
|
})
|
|
|
|
_base_0.__class = _class_0
|
|
|
|
return _class_0
|
|
|
|
end)()
|
|
|
|
Hello = (function()
|
|
|
|
local _parent_0 = What
|
|
|
|
local _base_0 = {
|
|
|
|
val = 2323,
|
|
|
|
something = function(self)
|
|
|
|
return (function()
|
|
|
|
local _base_1 = _parent_0
|
|
|
|
local _fn_0 = _base_1.something
|
|
|
|
return function(...)
|
|
|
|
return _fn_0(self, ...)
|
|
|
|
end
|
|
|
|
end)()
|
|
|
|
end
|
|
|
|
}
|
|
|
|
_base_0.__index = _base_0
|
|
|
|
if _parent_0 then
|
2011-12-04 03:17:06 +00:00
|
|
|
setmetatable(_base_0, _parent_0.__base)
|
2011-12-03 18:39:03 +00:00
|
|
|
end
|
|
|
|
local _class_0 = setmetatable({
|
|
|
|
__init = function(self, ...)
|
|
|
|
if _parent_0 then
|
|
|
|
return _parent_0.__init(self, ...)
|
|
|
|
end
|
2011-12-04 03:17:06 +00:00
|
|
|
end,
|
|
|
|
__base = _base_0,
|
|
|
|
__name = "Hello",
|
|
|
|
__parent = _parent_0
|
2011-12-03 18:39:03 +00:00
|
|
|
}, {
|
2011-12-04 03:17:06 +00:00
|
|
|
__index = function(cls, name)
|
|
|
|
local val = rawget(_base_0, name)
|
|
|
|
if val == nil and _parent_0 then
|
|
|
|
return _parent_0[name]
|
|
|
|
else
|
|
|
|
return val
|
|
|
|
end
|
|
|
|
end,
|
2011-12-03 18:39:03 +00:00
|
|
|
__call = function(cls, ...)
|
|
|
|
local _self_0 = setmetatable({}, _base_0)
|
|
|
|
cls.__init(_self_0, ...)
|
|
|
|
return _self_0
|
|
|
|
end
|
|
|
|
})
|
|
|
|
_base_0.__class = _class_0
|
|
|
|
return _class_0
|
|
|
|
end)()
|
|
|
|
do
|
|
|
|
local _with_0 = Hello()
|
|
|
|
x = _with_0:something()
|
|
|
|
print(x)
|
|
|
|
x()
|
2011-12-03 18:44:41 +00:00
|
|
|
end
|
|
|
|
local CoolSuper
|
|
|
|
CoolSuper = (function()
|
|
|
|
local _parent_0 = nil
|
|
|
|
local _base_0 = {
|
|
|
|
hi = function(self)
|
|
|
|
_parent_0.hi(self, 1, 2, 3, 4)(1, 2, 3, 4)
|
|
|
|
_parent_0.something(1, 2, 3, 4)
|
|
|
|
local _ = _parent_0.something(1, 2, 3, 4).world
|
|
|
|
_parent_0.yeah(self, "world").okay(hi, hi, hi)
|
|
|
|
_ = something.super
|
|
|
|
_ = _parent_0.super.super.super
|
|
|
|
return nil
|
|
|
|
end
|
|
|
|
}
|
|
|
|
_base_0.__index = _base_0
|
|
|
|
if _parent_0 then
|
2011-12-04 03:17:06 +00:00
|
|
|
setmetatable(_base_0, _parent_0.__base)
|
2011-12-03 18:44:41 +00:00
|
|
|
end
|
|
|
|
local _class_0 = setmetatable({
|
|
|
|
__init = function(self, ...)
|
|
|
|
if _parent_0 then
|
|
|
|
return _parent_0.__init(self, ...)
|
|
|
|
end
|
2011-12-04 03:17:06 +00:00
|
|
|
end,
|
|
|
|
__base = _base_0,
|
|
|
|
__name = "CoolSuper",
|
|
|
|
__parent = _parent_0
|
2011-12-03 18:44:41 +00:00
|
|
|
}, {
|
2011-12-04 03:17:06 +00:00
|
|
|
__index = function(cls, name)
|
|
|
|
local val = rawget(_base_0, name)
|
|
|
|
if val == nil and _parent_0 then
|
|
|
|
return _parent_0[name]
|
|
|
|
else
|
|
|
|
return val
|
|
|
|
end
|
|
|
|
end,
|
2011-12-03 18:44:41 +00:00
|
|
|
__call = function(cls, ...)
|
|
|
|
local _self_0 = setmetatable({}, _base_0)
|
|
|
|
cls.__init(_self_0, ...)
|
|
|
|
return _self_0
|
|
|
|
end
|
|
|
|
})
|
|
|
|
_base_0.__class = _class_0
|
|
|
|
return _class_0
|
|
|
|
end)()
|