lua-users home
lua-l archive

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


Patrick Donnelly  wrote: 
> > In that context the # operator is not well defined. I see two good
> > (though not perfect) solutions: either make the table # operator
> > deterministic (for example return the biggest integer key), or allow
> > users to override the # operator (that's my prefered solution, since
it
> > would be useful for other problems, like returning the norm of a
> > vector).
> 
> http://www.lua.org/manual/5.1/manual.html#2.8
> 
> __len??

I thought so initially, but it's not overridable for tables :-)