lua-users home
lua-l archive

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


>Looking at parser.c I spotted the symbol DOTS ('...'). I guessed it was a
>valid function parameter, and sure enough:
>
>function foo(x,...) print(x) end   foo("bar")
>
>was accepted, but (assuming the obvious) how do I access the parameter list
>within the body of foo()? Should I be doing this at all or is it a legacy
>from an earlier version, or maybe an internal reserved feature?

This is an experimental, unreleased implementation of variable argument lists.
It may become official in the next version. Or it may not :-)
If you look closer at the code, you'll find a function 'call' that is supposed
to be used with this.
--lhf