lua-users home
lua-l archive

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


On 1/1/11 11:19 PM, Axel Kittenberger wrote:
... current #
implementation into something like table.apex() and have # just call
meta __len, and if there is no meta __len error. Then its up to some
minimal basic lib to provide __len.

With a default __len() that simply returns number of elements, even if that
can be forbiddingly slow under unlucky circumstance.

On 1/1/11 9:23 PM, David J. Slate wrote:
... Intuitively, I would
have expected a "length operator" as applied to an associative table
to produce a count of its keys, regardless of what kind of table it
was.  

Henning