[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua 5.2 Length Operator and tables (bug?)
- From: Daurnimator <quae@...>
- Date: Wed, 18 Apr 2012 01:37:39 +1000
On 18 April 2012 01:17, Coda Highland <chighland@gmail.com> wrote:
>> Maybe (I dunno) it would be good to also habe a table.len function,
>> which does a slow but reliable count for all types of tables, but of
>> course the # operator still has a valuable place.
>
> This was exactly what I was thinking, and it's a good idea. Have
> table.len() iterate over the full (internally-allocated) length of the
> array part of the table and... what, return the highest index? return
> the number of non-nil elements? Which would be better?
>
> /s/ Adam
>
That's what table.maxn used to do; it was removed cause no one used it.
- References:
- Lua 5.2 Length Operator and tables (bug?), csrl
- Re: Lua 5.2 Length Operator and tables (bug?), Dirk Laurie
- Re: Lua 5.2 Length Operator and tables (bug?), Jose Torre-Bueno
- Re: Lua 5.2 Length Operator and tables (bug?), Krunal Rao
- Re: Lua 5.2 Length Operator and tables (bug?), Luiz Henrique de Figueiredo
- Re: Lua 5.2 Length Operator and tables (bug?), chris
- Re: Lua 5.2 Length Operator and tables (bug?), Miles Bader
- Re: Lua 5.2 Length Operator and tables (bug?), chris
- Re: Lua 5.2 Length Operator and tables (bug?), Miles Bader
- Re: Lua 5.2 Length Operator and tables (bug?), Coda Highland