lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Just on a point of language in 3.4.6:

Surely

"The length of a table is defined to be any index such that .... "
is incorrect.

Should it not be

"The length of a table t is defined to be the least non-negative
integer n such that t[n+1] is nil and t[m] is non-nil for any
positive integer less than n+1."?

I know my phrasing is longer but as the manual stands in the case that
t[1] = nil, t[2] = 0, t[3] = nil
it would imply that #t = 2.

Or should the phrase

"moreover, if t[1] = nil, n can be zero"

really be

"moreover, if t[1] = nil, n must be zero"

?



-- 
Gavin Wraith (gavin@wra1th.plus.com)
Home page: http://www.wra1th.plus.com/