lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> I gather that select is the way to access varargs in 5.1. Is that
> correct?

Depends. You can also collect them in a table (with "{...}") or directly
into variables (with "a,b,c = ..."), if you know how many of them you
want.


> Am I correct that every use of select makes a copy of all of the varargs
> and hence makes a loop over the arguments quadratic in the number of
> arguments?

Yes. For small number of arguments (say, less than five) this quadratic
behavior is not relevant. For larger numbers, it is cheapter to
create a table.

-- Roberto