Lua 单例类
function SingleTon:new() local store = nil return function(self) if store then return store end local o ={} setmetatable(o,self) self.__index = self store = o return o end end SingleTon.instance = SingleTon:new()
贵有恒,何必三更起五更眠;最无益,只怕一日曝十日寒