lua-users home
lua-l archive

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

On Tue, May 08, 2007 at 02:36:00PM -0300, Roberto Ierusalimschy wrote:
> > Wouldn't it be easy, and very low-overhead, to increment and decrement a
> > count for every add/remove? My countpairs() is O(n) :-(


> (Usually, most single needs have a simple, low-overhead, and quite
> efficient way to be implemented directly in Lua. But if we add each one
> of them to the language, the final result will be neither simple nor
> efficient.)

I understand that as a general principal.

In this case, I think the argument for having #t return the real table
size isn't that it adds a feature, but that it removes an annoying
special case, leading to a more regular and predictable language.