tests/pass/vararg.lua

Wed, 24 Nov 2010 02:52:37 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Wed, 24 Nov 2010 02:52:37 +0000
changeset 138
f9bb0e212d28
parent 126
07ec490c7a6f
permissions
-rw-r--r--

Replace error reporting code with calls to LVM.traceback()

function foo(a, b, ...)
	assert(a == 1);
	assert(b == 2);
	local c, d = ...;
	assert(c == 3);
	assert(d == 4);
	return a, b, ...;
end

local a, b, c, d = foo(1, 2, 3, 4);
assert(a == 1);
assert(b == 2);
print("c is", c);
assert(c == 3);
assert(d == 4);

mercurial