lua-users home
lua-l archive

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

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).

-Patrick Donnelly

"One of the lessons of history is that nothing is often a good thing
to do and always a clever thing to say."

-Will Durant