[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: please critique my first script
- From: Vaughan McAlley <ockegheim@...>
- Date: Thu, 19 Feb 2009 15:32:16 +1100
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