first commit
This commit is contained in:
commit
ed502bdf2a
6 changed files with 780 additions and 0 deletions
7
libs/clasp.lua
Normal file
7
libs/clasp.lua
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
-- evolbug 2017, MIT License
|
||||
-- clasp - class library
|
||||
|
||||
local class = { init = function()end; extend = function(self, proto) local meta = {}
|
||||
local proto = setmetatable(proto or {},{__index=self, __call=function(_,...) local o=setmetatable({},meta) return o,o:init(...) end})
|
||||
meta.__index = proto ; for k,v in pairs(proto.__ or {}) do meta['__'..k]=v end ; return proto end }
|
||||
return setmetatable(class, { __call = class.extend })
|
||||
Loading…
Add table
Add a link
Reference in a new issue