Skip to content

Instantly share code, notes, and snippets.

@Mons
Created July 29, 2015 21:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Mons/d5e9b7042c7b07bdff2b to your computer and use it in GitHub Desktop.
Save Mons/d5e9b7042c7b07bdff2b to your computer and use it in GitHub Desktop.
Class, super and gc
local weak = setmetatable({},{__mode = 'v'})
do
local Class = {}
-- function Class:super( class,method )
-- return function ()
-- print("work")
-- end
-- end
function Class:test()
self:super(Class,'method')()
end
weak.Class = Class
-- local o = setmetatable({},{__index = Class})
-- o:test()
end
collectgarbage('collect')
print(weak.Class)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment