[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: BUG in table.concat
- From: Alex Sandro Queiroz e Silva <asandroq@...>
- Date: Tue, 01 Jul 2008 12:57:25 -0300
Leo Razoumov wrote:
NOTE: the definition above never explicitly addresses the issue of
arrays with holes.
Is a hole an element with nil as a value (nil is nither string nor number)??
If it has holes it is *not* an array. This is the tricky part.
NOTE: the manual explicitly says that nil cannot be a value in an
array or table (nil also cannot be a valid key).
Direct interpretation of the paragraph above: "t=nil means that
array t does not contain an element t"
It is different from "t exists and has a value of nil".
(3) another discussion of arrays with holes
"For a regular array, with non-nil values from 1 to a given n, its
length is exactly that n,
the index of its last value. If the array has "holes" (that is, nil
values between other non-nil values),
then #t may 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)."
NOTE: according to (3) arrays can have elements with nil as a value,
contradiction with (2) "the value of a table field can be of any type
Wrong. You should read "nil values" here as "absence of values".