lua-users home
lua-l archive

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


Hi Steve,

On 1/8/11 8:56 AM, steve donovan wrote:
On Sat, Jan 8, 2011 at 9:21 AM, Henning Diedrich <hd2010@eonblast.com> wrote:
Isn't it pretty much guaranteed you'd never want to do
|table.insert(t,n,nil)|?
I got into a bad habit of using it like this when appending objects;
if they were nil, it was a no-op.  Basically, a lazy shortcut using a
quirk of the language.

Are you using insert(t,v) or insert(t,n,v)?

If the latter, why not the former? Where is the n coming from in those cases?

Thanks,
Henning