[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: table.remove problem
- From: "Patrick Donnelly" <batrick.donnelly@...>
- Date: Mon, 12 Nov 2007 22:28:53 -0700
I've found something I believe is undocumented in the manual about the
behavior of table.remove. If you have a table (as an array) with n
elements and you call table.remove(t, n+1) or with anything greater
than n, you remove the last element. The same seems to be true with
table.insert now that I just tested it. The behavior I expected was
that it would remove the element indexed by i only if it existed (and
fail silently otherwise).
"One of the lessons of history is that nothing is often a good thing
to do and always a clever thing to say."