[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Lua Garbage Collection
- From: "Marco Catunda" <catunda@...>
- Date: Fri, 21 Nov 1997 00:30:13 -0200
Hello,
Please someone could explain me how garbage collection work in lua.
Is this code correct?
------------
function gc_fallback( o )
print( "This is a garbage!" )
end
test = {}
tag = newtag()
settag( test, tag )
settagmethod( tag, "gc", gc_fallback() )
test.message = "Hello!!"
print( test.message )
test = nil
-----------
I have had this output:
Hello!!
but, I hoped this output message:
Hello!!
This is a garbage!
--- Marco Catunda
catunda@inf.puc-rio.br