Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help,
read this.
-
surtic
- Citizen
- Posts: 74
- Joined: Sat Jul 12, 2008 12:18 am
Post
by surtic »
t[#t+1] is the first empty spot
Nobody guarantees that. It could be the first, and it could be the last - it's simply undefined.
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
>
That's why I don't like lists with gaps.
Users browsing this forum: Google [Bot] and 4 guests