[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: use of gettop to change functionality
- From: steve donovan <steve.j.donovan@...>
- Date: Tue, 1 Mar 2011 13:39:13 +0200
On Tue, Mar 1, 2011 at 1:30 PM, Gunnar Zötl <gz@tset.de> 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.