This page is no longer maintained — Please continue to the home page at www.scala-lang.org

puzzlers of a primitive kind

1 reply
extempore
Joined: 2008-12-17,
User offline. Last seen 35 weeks 3 days ago.

Bringing the GenericRange thread together with equality, here's a fun
one for the "overloading ==" plan:

% scala -Yfuture-eqeq

scala> List(1L, 2L) contains 1
res0: Boolean = false

scala> Set(1L, 2L) contains 1
res1: Boolean = true

Loyal followers of the equality saga will understand why this is, but of
more immediate concern is: can such a thing be tolerated?

loverdos
Joined: 2008-11-18,
User offline. Last seen 2 years 27 weeks ago.
Re: puzzlers of a primitive kind

On Oct 25, 2009, at 24:56, Paul Phillips wrote:

> Bringing the GenericRange thread together with equality, here's a fun
> one for the "overloading ==" plan:
>
> % scala -Yfuture-eqeq
>
> scala> List(1L, 2L) contains 1
> res0: Boolean = false
>
> scala> Set(1L, 2L) contains 1
> res1: Boolean = true
>
> Loyal followers of the equality saga will understand why this is,
> but of
> more immediate concern is: can such a thing be tolerated?
>

Practitioner's Report: Not in the real world of today, IMHO.

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland