[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: sunday afternoon whishlist
- From: Henk Boom <henk@...>
- Date: Fri, 4 Jun 2010 12:09:05 -0400
On 2 June 2010 12:22, Stuart P. Bentley <stuart@testtrack4.com> wrote:
> Because Lua doesn't limit the language to accommodate errors. It's better to
> be able to do things like use functions as iterators that weren't designed
> to take all the parameters passed by the generic for.
This is definitely a valid use case, but checking for the correct
number of arguments would not limit lua in any way, nor prevent you
from doing this. Putting ... at the end of the argument list would not
only let you ignore irrelevant arguments, but serve as in-code
documentation that you are doing so.
> If you find you're having a lot of trouble with functions taking the wrong
> number of parameters, consider using this:
These checks being done in lua involve a pretty high performance
penalty, which is too expensive for my applications. It also means you
have to provide redundant information, the number of arguments a
function takes.
henk