[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Shorthand for appending to a table (was Re: 5.2 feature list?)
- From: Nick Gammon <nick@...>
- Date: Wed, 13 Sep 2006 08:27:35 +1000
On 12/09/2006, at 3:40 AM, Eric Scouten wrote:
In that case, it's not too awful, but if the table has a meaningful
name, it become sort of cumbersome:
tableWithMeaningfulName[ #tableWithMeaningfulName + 1 ] = value
Another problem, apart from readability, is when copying and pasting:
AnothertableWithMeaningfulName[ #tableWithMeaningfulName + 1 ] = value
Oops! I changed the table name but forgot to change the name in the
brackets.
Maybe I should stick with table.insert, however the latest book
recommends against it.
- Nick