local function class() local T = {} T.__index = T return T end local function extend(Base) local T = {} T.__index = T for k,v in pairs(Base) do if k:sub(1,2) == "__" and k~="__index" then T[k]=v end end setmetatable(T,{__index=Base}) end return setmetatable({ class=class, extend=extend },{__call=class})