[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
**Subject**: **Re: tables**
**From**: Wim Couwenberg <w.couwenberg@...>
**Date**: Mon, 6 Mar 2006 21:06:19 +0100

>>> it
>>> would be convenient (and consistent) if the # operator
>>> provided the following behaviour (this is the assertion):
>>>
>>> "# provides the same number as the number of iterations
>>> provided by ipairs".
CW>> Convenient maybe, but also more expensive. The current # implementation
CW>> is O(log(N)) where N is the number of entries in the array part. The
> plus, it would change the semantics of the # operator such that the
> expression t[#t+1]==nil would not necessarily be true any more.
That would still be true. (ipairs stops at the first nil value.)
--
Wim