On Fri, Dec 30, 2011 at 4:09 AM, Nikolai Weibull <now / bitwi.se> wrote:

> On Fri, Dec 30, 2011 at 10:44, Josh Cheek <josh.cheek / gmail.com> wrote:
> > On Fri, Dec 30, 2011 at 3:09 AM, Nikolai Weibull <now / bitwi.se> wrote:
>
> >> It would make implementing #hash, which you should/must do
> >> if you implement #=3D=3D, trivial, as there=92s then only one way to d=
o so.
>
> > Delegating to the most relevant attribute still seems more trivial.
>
> Trivial =96 perhaps.  Wrong =96 most definitely.  That you don=92t seem t=
o
> understand this is what tells me that you don=92t understand how #hash
> should be implemented.
>
>
Feel free to explain why it is wrong.


> > I suppose one reason I take this view could be that the only viable
> > scenarios I can think of for making some arbitrary object into a hash k=
ey
> > are for sets and Array#uniq. For me, these scenarios are exceedingly
> rare,
> > and have always been trivially replaced with alternative keys.
>
> How about having them as keys in an actual Hash (which is how Sets and
> Array#uniq are currently implemented)?
>
>
Which is why I mentioned it.