lua-users home
lua-l archive

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


2009/2/19 Etan Reisner <deryni@unreliablesource.net>:
> Personally I tend to avoid using table.insert in favor of
>    tab[#tab + 1] = item
> or keeping an explicit counter, but that probably doesn't matter much
> except in tight loops.
>

It took me a while to work out why this is popular (apart from
featuring heavily in Programming in Lua). It's because this method
allows access to metamethods, while table.insert doesn't. Am I right?

-Vaughan