Improve argument type checking.

This commit is contained in:
James Roseborough
2008-07-24 01:28:52 +00:00
parent 45e60c4b21
commit 022202e578
3 changed files with 23 additions and 14 deletions

View File

@@ -23,8 +23,9 @@ function new(a)
end
-- basic weak-reference table test
local weak = newtable{ new('one'), new('two'), new('three'), new('four'), a=new('aaa'), b=new('bbb'), c=new('ccc'), d=new('ddd') }
local strong = { weak[1], weak[3], a=weak.a, c=weak.c }
local strong = { new('one'), new('two'), a=new('aaa'), c=new('ccc') }
local weak = newtable{ strong[1], new('three'), strong[2], new('four'),
a=new('aaa'), b=new('bbb'), c=new('ccc'), d=new('ddd') }
print( 'before, weak:', eles(weak) )
print( 'before, strong:', eles(strong) )
print( 'gc', pcall( collectgarbage, "collect" ) )