lua-users home
lua-l archive

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


Why do you want the runtime to check for the correct number of arguments rather than having your own function check? The language is very flexible and makes it easy to validate both missing and too many arguments if that's important to your usage.
-gary


On May 11, 2010, at 12:17 PM, Henk Boom wrote:

On 11 May 2010 12:50, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
Unfortunately it is not true ;) The _expression_ "#..." does make sense
and has a clear meaning, consistent with #f(x) (and with -f(x), -...,
etc.). And there are no plans to change varargs in 5.2.

One thing I wonder is why functions accept any number of arguments by default, instead of requiring an exact number (this is a pet peeve of mine, since I often call functions with the wrong number of arguments by accident). Functions which require a variable number of arguments (or optional arguments) could still use ... to get them.

    henk