[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [Feature Request?] __key
- From: "Soni L." <fakedme@...>
- Date: Mon, 18 Jul 2016 10:32:40 -0300
On 18/07/16 04:21 AM, Tim Hill wrote:
On Jul 17, 2016, at 8:32 PM, Philipp Janda <siffiejoe@gmx.net
<mailto: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.
You don't seem to have any issues with integral floats. How are they any
different?
As I and others have noted, the functionality needed by the OP can be
done by interning, or by the appropriate use of metatables.
With returning plain integers (for interoperability with plain Lua keys)
I'd have to use bigint.add(bigint(1), bigint(2)) instead of bigint(1) +
bigint(2), which makes it literally impossible to write code that works
with both bigints and plain numbers.
With __index and __newindex I can't use code I don't control.
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.
This isn't ad hominem.
—Tim
--
Disclaimer: these emails may be made public at any given time, with or without reason. If you don't agree with this, DO NOT REPLY.
- References:
- Fwd: [Feature Request?] __key, Tim Hill
- Re: Fwd: [Feature Request?] __key, Soni L.
- Re: [Feature Request?] __key, Tim Hill
- Re: [Feature Request?] __key, Coda Highland
- Re: [Feature Request?] __key, Tim Hill
- Re: [Feature Request?] __key, Sean Conner
- Re: [Feature Request?] __key, Philipp Janda
- Re: [Feature Request?] __key, Tim Hill
- Re: [Feature Request?] __key, Philipp Janda
- Re: [Feature Request?] __key, Tim Hill