Tristan Zajonc (2013-10-29T17:51:10.000Z)
domenic at domenicdenicola.com (2013-11-03T22:03:43.418Z)
On Tue, Oct 29, 2013 at 10:04 AM, Brendan Eich <brendan at mozilla.com> wrote: > You bet, but special forms exist to have primitive semantics, which can be > meta-programmed only in certain ways (we try to preserve certain > invariants). With .equals, anything goes. With == where both operands are > object references, there has been an invariant. Allowing operator > customization to break that invariant might be worth the downside, but it > deserves discussion. Got it, worthy of discussion. My user data point is that I've never assumed == has that invariant. Overloading equals is a bigger deal, but it's not clear users should expect invariance given existing toString/valueOf issues. So +1 for this not being a blocker to extending your operator proposal more broadly.