Tem
public lua v1 · immutablelocal registry = {}LimitedCache = { new = function(self,max) local o = setmetatable({},self) registry[o] = {max = max} return o end, __newindex = function(t,k,v) local mt = registry[t] if(table.getn(mt) == mt.max) then t[table.remove(mt,1)] = nil end table.insert(mt,k) rawset(t,k,v) end,}