lua-users home
lua-l archive

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



> On Jun 23, 2018, at 8:57 AM, Andrew Gierth <andrew@tao11.riddles.org.uk> wrote:
> 
>>>>>> "Kenneth" == Kenneth Lorber <keni@his.com> writes:
> 
> Kenneth> require() seems to silently accept extra arguments. Is this a
> Kenneth> bug?
> 
> Pretty much every function accepts and silently ignores extra arguments,
> unless the function itself bothers to check for them and throw an
> explicit error.
> 
> -- 
> Andrew.

Thanks, and after a little source diving you are correct, but that's not quite the reply I was looking for.

Is there some reason this is a language feature?  Some use-case I don't see?  (If so, why is there the occasional check for extra arguments?)

Is it documented somewhere I missed?

Is there any reason not to add checks for extra arguments?  If it's performance, it could be available as a compile time option.

I'm working for an implementation for 5.3.4.  If there's any interest please let me know or I'll just quietly add it to my copy and stop bothering the list about it.

Thanks,
Keni