Operator overloading for non-value objects

Anne van Kesteren annevk at annevk.nl
Mon Jan 13 02:45:26 PST 2014

In a discussion I had with Alex Russell as how to do comparison for
URL objects it ended up with desiring

  url == url2

to work. It escaped me at that point that I already discussed this
briefly and Brendan explained why face-to-face. However, I forgot what
he said :/

The alternative, either something like



  URL.equal(url, url2)


  url.toString() == url2.toString()

is somewhat Java-esque. Is that what we should do? And if so, opinions
on which variant?


More information about the es-discuss mailing list