lua-users home
lua-l archive

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



> 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??

-Patrick Donnelly

"One of the lessons of history is that nothing is often a good thing to do and always a clever thing to say."

-Will Durant