lua-users home
lua-l archive

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


> 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