lua-users home
lua-l archive

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


2013/1/23 John Hind <john.hind@zen.co.uk>:
>
>>> The behaviour of table.insert and table.remove in Lua 5.2.1 is odd and
>>> not fully documented.
>
>>It was given an array with one entry (ie index 1) and asked to insert an
> invalid index (-10) >before it, therefore it moved index the current # entry
> to #+1.
>
> "therefore" (!?!)
>
> A spirited legal defence, Liam. However as an engineer I try to fix and
> improve things, not get my clients off on a legal technicality (or convict
> people). Trying to make software better is the highest compliment I know how
> to make a fellow coder: most software just is not worth this effort!
>

This subject is a hardy perennial. For example (by no means the only one)
look up the archives from mid-December 2010 to mid-January 2011, especially
the thread "Definition of table.insert", which only petered out after
Roberto said:

> May I ask the list to stop the discussion about arrays/holes/#/lists/
> table.insert?
>
> We have had hundreds of messages about this subject in less than a
> month. ...
>
> Please, avoid the vanity of thinking that your message will be the
> one to solve all the mess.