[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: 5.2 work3 manual
- From: Doug Currie <doug.currie@...>
- Date: Wed, 19 May 2010 17:15:56 -0400
On May 19, 2010, at 12:33 PM, Tony Finch wrote:
> On Wed, 19 May 2010, Doug Currie wrote:
>> Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio
>>> nil_t = {}
>>> t = {}
>>> setmetatable(t,{ __index = function () return nil_t end })
>>> return #t
>> 0
>>> return t[1]
>> table: 0x100109640
>>>
>>
>> -- Note: t[n+1] is not nil!
>
> Er, yes, that's kind of the point.
But that ignores my point: should the documentation say:
The length of a table t is defined to be any integer index n such that rawget(t,n) is not nil and rawget(t,n+1) is nil
rather than
The length of a table t is defined to be any integer index n such that t[n] is not nil and t[n+1] is nil
?
e
- References:
- Re: 5.2 work3 manual, Luiz Henrique de Figueiredo
- Re: 5.2 work3 manual, Gavin Wraith
- Re: 5.2 work3 manual, Gavin Wraith
- Re: 5.2 work3 manual, Duncan Cross
- Re: 5.2 work3 manual, Gavin Wraith
- Re: 5.2 work3 manual, Roberto Ierusalimschy
- Re: 5.2 work3 manual, Gavin Wraith
- Re: 5.2 work3 manual, Gavin Wraith
- Re: 5.2 work3 manual, Tony Finch
- Re: 5.2 work3 manual, Doug Currie
- Re: 5.2 work3 manual, Tony Finch