Re: killing a set of elements from a list...
Posted: Fri Aug 29, 2008 12:02 am
Nobody guarantees that. It could be the first, and it could be the last - it's simply undefined.t[#t+1] is the first empty spot
Code: Select all
Lua 5.1.2 Copyright (C) 1994-2007 Lua.org, PUC-Rio
> x = {1,2,3,4,5,6,7}
> x[3] = nil
> x[5] = nil
> =#x
7
> x[7] = nil
> =#x
2
>