Re: Possible bug with the length operator
[
Date Prev][
Date Next][
Thread Prev][Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Possible bug with the length operator
- From: Axel Kittenberger <axkibe@...>
- Date: 2011年3月31日 20:12:47 +0200
> According to the Lua reference manual, the length operator (#) is supposed
> to return the highest consecutive numerical index. This means the above code
> SHOULD return 2, because 3 is nil.
No, it doesnt say that. it can be any n so that t[n] ~= nil and t[n+1]
== nil or 1 if t[1] == nil.