Finding the spirit of L-World
forax at univ-mlv.fr
Sat Feb 23 11:25:58 UTC 2019
----- Mail original -----
> De: "John Rose" <john.r.rose at oracle.com>
> À: "Kevin Bourrillion" <kevinb at google.com>
> Cc: "valhalla-spec-experts" <valhalla-spec-experts at openjdk.java.net>
> Envoyé: Samedi 23 Février 2019 03:57:56
> Objet: Re: Finding the spirit of L-World
> On Feb 22, 2019, at 11:42 AM, Kevin Bourrillion <kevinb at google.com> wrote:
>> I think we should make users write `equals` to test value types. If they write
>> `==`, they are indicating a special situation where they need identity
>> semantics, which don't make sense for value types, and that should be an error.
> This sounds like a proposal for the future, but as Brian points
> out it is also a constraint on large amounts of generic code
> that has already been written.
No it's not because there is no reified generics code yet.
You don't need to support == on a T which can be reified, because at the same time you add 'any' in front of T (or whatever way to say that the container class is a reified generics) you can also replace the use of == + equals (LIFE) to use substituableEquals() instead.
> Let's make the best of op==; it's in our past and the future
> of comparison logic in Java is too tightly coupled with the past.
This remember me another issue, we are discussing a lot about Java the language but that's not the only language that run on the JVM, by making acmp be an equivalent of substituableEquals() we are making a choice of semantics that may be ok for Java the language but clearly this change of semantics also impact the other languages, i'm thinking about Clojure's identical? by example.
> — John
More information about the valhalla-spec-observers