[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua 5.2 Length Operator and tables (bug?)
- From: Coda Highland <chighland@...>
- Date: Tue, 17 Apr 2012 10:17:13 -0500
> 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