lua-users home
lua-l archive

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




On 14 January 2011 11:43, Gunnar Zötl <gz@tset.de> wrote:

>I find this interesting. Why are the results from table.remove different from table[index]=nil?I realise

probably because table.remove shifts down the following elements, thus changing index and position of the following elements, whereas setting some table element to nil does not mess with the association between indices and stored values.

See http://www.lua.org/manual/5.1/manual.html#pdf-table.remove

Gunnar


In that case it really needs a special note adding about when iterating.

Thanks Liam