[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Feature Suggestion: Make rawset() coerce "nothing" as its 3rd argument to nil, don't error
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Wed, 18 Jul 2012 18:55:05 -0300
> What I find surprising is that even though Lua functions implemented
> without vararg convert missing arguments to nil, the core functions
> with a finite number of arguments don't. I'd expect them to do the
> same.
C functions are always varagrs and so are allowed to do whatever they
seem fit with respect to arguments. For the functions in the standard
Lua library, it's a question of what we deem to be more useful to the
Lua programmer who is going to use them. Do you really want to write
tostring() without arguments? What for?
Do you really want to write rawset(t,k) to save you from typing rawset(t,k,nil)?