- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
puzzlers of a primitive kind
Sat, 2009-10-24, 22:56
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?
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.