[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Possible bug relating to table sizes
- From: Dirk Laurie <dirk.laurie@...>
- Date: Sat, 29 Oct 2011 15:16:11 +0200
2011/10/29 Axel Kittenberger <email@example.com>:
> # is not biuniquely defined for non linear tables that do not go from
> 1...n. You can read up the exact definition of #, but usually just
> don't do it for something that is not defined 1..n.
> The length of a table t is defined to be any integer index n such that
> t[n] is not nil and t[n+1] is nil; moreover, if t is nil, n can be
Lua 5.2 beta pitches it more strongly: # is _undefined_ for tables
that do not go from 1...n, unless you have defined a __len metamethod.
So that last sentence is no longer valid.