The following code:
myList = {1, 5, 9, 10}
myList[8] = 8
table.remove(myList,8)
Should produce a table with a border at 4, nil in keys 5 and 6, and 8 at key 8, then delete the 8. This program works.
However, the following:
myList = {1, 5, 9, 10}
myList[9] = 8
table.remove(myList,9)
does not work, saying that the call to table.remove is out of bounds!
This is contradictory: myList[9] is a non-null entry, and if table.remove requires that there are no borders before the given entry, then the border at 4 should have caused the first example to fail too. The only difference is that the gap in the keys is one step wider!
What's happening here and is it something I can correct?