lua-users home
lua-l archive

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



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