lua-users home
lua-l archive

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


On Fri, Jul 20, 2012 at 8:09 AM, steve donovan
<steve.j.donovan@gmail.com> wrote:
> Oh and they can be nasty - think about io.lines - if there was no
> distinction between io.lines() and io.lines(nil) then a script could
> easily jam due to a silly error.  It's better to fail with a big fuss
> than just hang!

Actually, that's an example of arity-based polymorphism, where the
behavior of the function depends on the number of arguments.

What I plead for is to accept a lack of value where a nil would be
legal, not the other way around (but that was probably not clear from
my previous post).

-- Pierre-Yves