[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: lua-5.1-alpha: length operator on tables (arrays) and nil values
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Tue, 13 Sep 2005 19:26:38 -0300
>How to handle nil arguments in vararg functions?
Nil args are handled fine. The exact number of args passed to a vararg
function is the result of select('#',...).
Try this:
function f(...)
print(select('#',...), ...)
end
f(1,2,nil,4)
f(1,nil,3,nil)
f(1,2,3)
--lhf