Is V? what we need ?
Brian Goetz
brian.goetz at oracle.com
Wed May 1 13:28:33 UTC 2019
Also, we’re conflating two separate questions here.
1. What does V? mean. In the proposed world, it is the union type of V and Null, nothing more (alternately: V adjoined with null.).
2. What is the relationship between V and V? — is it sub typing, or conversion?
I think Remi is more interested in (2), but you keep saying “it should be a box”,w which suggests we’re not on the same page with respect to (1) either, yet.
> On May 1, 2019, at 9:24 AM, Brian Goetz <brian.goetz at oracle.com> wrote:
>
>>
>> a box is a necessary evil, everybody want to write an ArrayList<int> but we are not there yet, so we provide just the right abstraction to deal with value type in generics, not more.
>
> I think this is where we part ways. In Java 1.0, with respect to primitives, a box was a necessary evil, because ints are not Objects. In Q-world, when we thought we couldn’t get away with values being Object, we thought it was a necessary evil again. L-world taught us we don’t need boxes, and that’s a huge weight lifted off our shoulders!
>
> Boxes are messy; if they are necessary, we can live with them, but if they are not, why would we want to?
>
> There are two paths here:
> - Cripple values exactly as much as primitives are crippled, and everyone is on an even footing;
> - Make values what we want everything to be, and catch up later with primitives to the extent we can.
>
> But, you’re not making your case, you’re just saying “I think it should be the other way.” Make the case why the proposed new way is worse!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/valhalla-spec-experts/attachments/20190501/208e846e/attachment.html>
More information about the valhalla-spec-experts
mailing list