lua-users home
lua-l archive

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

> On Tue, 1 Mar 2011, Gunnar Zötl wrote:
> >
> > > foo(nil,nil,nil) should be the same as foo(nil,nil) and foo() etc
> >
> > Nope, it should not. Passing three nils is not the same as passing
> > nothing at all.
> table.insert() should have its two-argument form separated out into a
> table.append() function - which could quite nicely append multiple values.

This is kinda weird. How is it that when a guy makes a post containing 2 generic claims and one specific observation, and another guy (me) replies to the generic claims, loads of folks contradict using the specific thing as a reason for that? I do agree that table.insert is strange in some regards, handle with care. But that does not say anything about the generic claims.

I stand by what I said, calling foo() is not and should not be the same as calling foo(nil). Steve D gave a perfectly valid example of why this is true.