lua-users home
lua-l archive

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



On Jul 17, 2016, at 8:32 PM, Philipp Janda <siffiejoe@gmx.net> wrote:


The point is really this: __key modifies the contract for a table
dramatically.

What exactly is the contract for a table? Taking metamethods into account there is not much we can say for sure about the behavior of a table ...


To my mind there is a huge difference between explicitly modifying table behavior via a metatable, and having behavior changed as a side effect of storing a userdata item as a key.

As I and others have noted, the functionality needed by the OP can be done by interning, or by the appropriate use of metatables.

And as others have noted, this thread is really going nowhere and is now drifting into ad hominem (not by you), so I’m dropping out.

—Tim