[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: A question about table's length
- From: Klaus Ripke <paul-lua@...>
- Date: Tue, 29 Dec 2009 11:03:19 +0100
Hello visli
On Tue, Dec 29, 2009 at 05:34:48PM +0800, h visli wrote:
> With the description of manual.html#2.5.5 , the length of b should be 1 rather than 3. Because b[2]'s value is nil, so the array has "holes".
please take the time to read all five sentences of 2.5.5,
especially before assuming Lua does not work properly
and/or other people write nonsense.
The fifth sentence is:
"
If the array has "holes" (that is, nil values between other non-nil values),
then #t CAN BE ANY of the indices that directly precedes a nil value
(that is, it may consider any such nil value as the end of the array).
"
So 3 is perfectly ok.
thank you very much