lua-users home
lua-l archive

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

On Tue, Mar 1, 2011 at 1:30 PM, Gunnar Zötl <> wrote:
> Nope, it should not. Passing three nils is not the same as passing nothing at all.

And this is in fact useful.

Consider the library function io.lines(); called without any
arguments, it iterates over standard input. Pass it a file name, it
iterates over that file if it can.

It would _not_ be nice if io.lines(nil) would open stdin, since an
accidental nil variable is all too common. Instead, it gives you an
error, as it should.

steve d.