Re: value type hygiene

2018-05-15 Thread John Rose
On May 15, 2018, at 5:17 PM, Dan Smith wrote: > >> On May 15, 2018, at 4:53 PM, John Rose wrote: >> >> If we can implement EVBCs easily as a one-off from full value type, >> in the context of L-world, should we try it? People responsible for >>

Re: value type hygiene

2018-05-15 Thread Dan Smith
> On May 15, 2018, at 4:53 PM, John Rose wrote: > > If we can implement EVBCs easily as a one-off from full value type, > in the context of L-world, should we try it? People responsible for > user model (hi Brian!) might say "yuck, we are admitting design > failure by

Re: value type hygiene

2018-05-15 Thread John Rose
More on your annotation proposal: One way to look at it is that you are proposing two new kinds of concrete classes to go with our old object class. - object class = what we have today: identity-rich, nullable, not flattened - value class = new, flattened*, not nullable, identity-free -

Re: value type hygiene

2018-05-15 Thread John Rose
On May 15, 2018, at 12:35 PM, Dan Smith wrote: > > I don't think it would be acceptable to change the meaning of code like this: > > LocalDate[] dates = new LocalDate[10]; > void set(int i, LocalDate d) { dates[i] = d; } > boolean check(int i) { return dates[i] != null;

Re: value type hygiene

2018-05-15 Thread John Rose
> On May 15, 2018, at 12:32 PM, Paul Sandoz wrote: > > > >> On May 14, 2018, at 11:36 PM, John Rose wrote: >> ... >> Eventually when int[] <: Object[], then >> int[].class.getClass().getDefaultValue() >> will return an appropriate zero value,

Re: value type hygiene

2018-05-15 Thread forax
> De: "John Rose" > À: "Remi Forax" > Cc: "Brian Goetz" , "valhalla-spec-experts" > > Envoyé: Mardi 15 Mai 2018 22:27:13 > Objet: Re: value type hygiene > On May 15, 2018, at 1:05 AM, [

Re: value type hygiene

2018-05-15 Thread John Rose
On May 15, 2018, at 5:06 AM, Maurizio Cimadamore wrote: > > I wonder if we shouldn't also consider something along the lines of > restricting migration compatibility only for _nullable_ value types, where a > nullable value type is a value whose representation

Re: value type hygiene

2018-05-15 Thread John Rose
On May 15, 2018, at 1:05 AM, fo...@univ-mlv.fr wrote: > > > ... > You must admit this use of supers to carry nullable values is possible, > but you are saying (I think) that you don't agree that this is useful. > > We have already decided that j.l.Object is the super that can carry null, so >

Re: value type hygiene

2018-05-15 Thread Dan Smith
> On May 14, 2018, at 5:02 PM, John Rose wrote: > > Think of V[] as a global type, > and you'll see that it needs a global definition of what is flattened and > what is nullable. I think we will get away with migrating types and > declaring that legacy classes that use

Re: value type hygiene

2018-05-15 Thread Paul Sandoz
> On May 14, 2018, at 11:36 PM, John Rose wrote: > > On May 14, 2018, at 6:53 PM, Paul Sandoz wrote: >> >> Hi John, >> >> The answers below might depend on experimentation but what might you propose >> the behavior should be for the following

Re: value type hygiene

2018-05-15 Thread Maurizio Cimadamore
I wonder if we shouldn't also consider something along the lines of restricting migration compatibility only for _nullable_ value types, where a nullable value type is a value whose representation is big enough that it can afford one spare value to denote null-ness. So, if you want to convert

Re: value type hygiene

2018-05-15 Thread forax
> De: "John Rose" > À: "Remi Forax" > Cc: "Brian Goetz" , "valhalla-spec-experts" > > Envoyé: Mardi 15 Mai 2018 08:56:49 > Objet: Re: value type hygiene > On May 14, 2018, at 11:12 PM, [

Re: value type hygiene

2018-05-15 Thread John Rose
On May 14, 2018, at 11:12 PM, fo...@univ-mlv.fr wrote: > > > > De: "John Rose" > À: "Remi Forax" > Cc: "Brian Goetz" , "valhalla-spec-experts" > > Envoyé: Mardi 15 Mai 2018 01:53:31 >

Re: value type hygiene

2018-05-15 Thread John Rose
On May 14, 2018, at 6:53 PM, Paul Sandoz wrote: > > Hi John, > > The answers below might depend on experimentation but what might you propose > the behavior should be for the following code, assuming we have no > specialized generics, ArrayList is not yet modified to

Re: value type hygiene

2018-05-15 Thread forax
> De: "John Rose" > À: "Remi Forax" > Cc: "Brian Goetz" , "valhalla-spec-experts" > > Envoyé: Mardi 15 Mai 2018 01:53:31 > Objet: Re: value type hygiene > On May 14, 2018, at 4:13 PM,