lua-users home
lua-l archive

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


> 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)?