valhalla-dev Digest, Vol 7, Issue 24

Simon Ochsenreither simon at ochsenreither.de
Fri Jan 9 13:40:43 UTC 2015


> To answering a few questions:
> 
>> a) What are the actual semantics?
> 
> For ref-types:  
>     x eq y  -->   (x != null && x.equals(y))
> For value-types:
>     x eq y  -->   (x == y)

What's wrong with giving == and != a sensible implementation for value
types as mentioned earlier? This would avoid introducing a new concept
and would not require rewriting every equals/contains/... method in
existence.


>> b) How is this different to the approaches already outlines earlier?
> 
> It provides a basic logical building-block (equality check) at the
> language level, in a way that works both for primitives/valuetypes and
> for nullable references. It addresses a very big long-standing pain
> point in Java application development. It avoids writing/ or encouraging
> "Duck.woof()" style-hacks -- null checks -- into a domain that does not
> uniformly support them.

Isn't this what was proposed earlier, just with == instead of
introducing a new operator?


More information about the valhalla-dev mailing list