[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: 5.2 work3 manual
- From: Florian Weimer <fw@...>
- Date: Sun, 23 May 2010 11:04:47 +0200
* Gavin Wraith:
> Is the following a correct restatement of what #t means for a table t?
>
> The length, #t, of a table t may take different values, but is
> guaranteed to be 0 if t[1] is nil and to be n if t[n+1] is nil
> and t[m] is not nil for all positive integers m less than n+1.
I think that that implication goes into the wrong direction. It
should be something like: if #t == n, then n == 0 and t[1] == nil, or
t[n] != nil and t[n + 1] == nil. This can be simplified slightly to:
if #t == n, then (n == 0 or t[n] != nil) and t[n + 1] == nil.