[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Wording in sequence definition [Was: The terms "sequence", "list", etc in Lua 5.2.0 (beta-rc1)]
- From: HyperHacker <hyperhacker@...>
- Date: Thu, 16 Jun 2011 09:42:57 -0600
On Jun 16, 2011 8:49 AM, "steve donovan" <steve.j.donovan@gmail.com> wrote:
>
> On Thu, Jun 16, 2011 at 4:41 PM, HyperHacker <hyperhacker@gmail.com> wrote:
> > Does that mean a table having keys 0, -1 or 1.5 no longer has a defined
> > length?
>
> Would you mean a table just with keys like that, e..g {[0] = 1, [-1] =
> 2}? Because there #t was always zero. It seems that if the table has
> an 'array part' (the [1..n] sequence) then #t gives the length of that
> array part. Certainly a lot of code does assume that one can add
> things to an 'array' in this way without upsetting the length
> operator.
>
> steve d.
>
Not just those, but including them. E.g. t={'a', 'b', 'c', [-1]='y', [0]='z', [1.5]='foo'}; #t=??
I would expect it to still be 3. Is that not the case?
--
Sent from my toaster.
- References:
- The terms "sequence", "list", etc in Lua 5.2.0 (beta-rc1), Dirk Laurie
- Re: The terms "sequence", "list", etc in Lua 5.2.0 (beta-rc1), Roberto Ierusalimschy
- Re: The terms "sequence", "list", etc in Lua 5.2.0 (beta-rc1), Xavier Wang
- Re: The terms "sequence", "list", etc in Lua 5.2.0 (beta-rc1), David Manura
- Re: Wording in sequence definition [Was: The terms "sequence", "list", etc in Lua 5.2.0 (beta-rc1)], Lorenzo Donati
- Re: Wording in sequence definition [Was: The terms "sequence", "list", etc in Lua 5.2.0 (beta-rc1)], Lorenzo Donati
- Re: Wording in sequence definition [Was: The terms "sequence", "list", etc in Lua 5.2.0 (beta-rc1)], HyperHacker
- Re: Wording in sequence definition [Was: The terms "sequence", "list", etc in Lua 5.2.0 (beta-rc1)], steve donovan