Re: vararg, table and nil - again
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: vararg, table and nil - again
- From: PA <petite.abeille@...>
- Date: 2007年6月28日 22:42:06 +0200
On Jun 28, 2007, at 22:05, Rici Lake wrote:
function replace_empty_with_nil(...)
local args = {n=select("#", ...), ...}
for i = 1, args.n do
if args[i] == "" then args[i] = nil end
end
return args
end
someArguments = replace_empty_with_nil(f())
aHandler(unpack(someArguments, 1, someArguments.n))
Thanks for the detailed explanation, the fog of confusion is slowly
dissipating now... :)
Cheers,
PA.
P.S. Yes, the subtraction in the initial code was indeed intentional.