Re: New JEP: Concise Method Bodies

2018-10-09 Thread forax
> De: "Kevin Bourrillion" > À: "Remi Forax" > Cc: "daniel smith" , "amber-spec-experts" > > Envoyé: Mardi 9 Octobre 2018 21:39:07 > Objet: Re: New JEP: Concise Method Bodies > On Tue, Oct 9, 2018 at 12:34 PM < [ mailto:fo...@uni

Re: New JEP: Concise Method Bodies

2018-10-09 Thread Brian Goetz
Precisely so.  Records form the sweet spot where construction protocol, deconstruction protocol, equality and hashCode protocol, and representation are identical.  The probability that you would also want to use the state vector as a dictionary-order comparator is very, very small. (Please, l

Re: New JEP: Concise Method Bodies

2018-10-09 Thread Brian Goetz
v.fr wrote: *De: *"Kevin Bourrillion" *À: *"daniel smith" *Cc: *"Remi Forax" , "amber-spec-experts" *Envoyé: *Mardi 9 Octobre 2018 20:48:10 *Objet: *Re: New JEP: Concise Method Bod

Re: New JEP: Concise Method Bodies

2018-10-09 Thread forax
> De: "Kevin Bourrillion" > À: "Remi Forax" > Cc: "daniel smith" , "amber-spec-experts" > > Envoyé: Mardi 9 Octobre 2018 21:03:42 > Objet: Re: New JEP: Concise Method Bodies > I do like that feature, but, aren't statics

Re: New JEP: Concise Method Bodies

2018-10-09 Thread Kevin Bourrillion
On Tue, Oct 9, 2018 at 12:15 PM wrote: > We have a rich API for building Comparators. I would expect most > non-legacy implementations of Comparable to implement their 'compareTo' > method by delegating to a Comparator. And you don't want to build the > Comparator each time the 'compareTo' method

Re: New JEP: Concise Method Bodies

2018-10-09 Thread forax
> De: "daniel smith" > À: "Remi Forax" > Cc: "amber-spec-experts" > Envoyé: Mardi 9 Octobre 2018 20:43:03 > Objet: Re: New JEP: Concise Method Bodies >> On Oct 9, 2018, at 12:00 PM, Remi Forax < [ mailto:fo...@univ-mlv.fr | >> fo...@u

Re: New JEP: Concise Method Bodies

2018-10-09 Thread Kevin Bourrillion
t; > *De: *"Kevin Bourrillion" > *À: *"daniel smith" > *Cc: *"Remi Forax" , "amber-spec-experts" < > amber-spec-experts@openjdk.java.net> > *Envoyé: *Mardi 9 Octobre 2018 20:48:10 > *Objet: *Re: New JEP: Concise Method Bodies > >

Re: New JEP: Concise Method Bodies

2018-10-09 Thread forax
> De: "Kevin Bourrillion" > À: "daniel smith" > Cc: "Remi Forax" , "amber-spec-experts" > > Envoyé: Mardi 9 Octobre 2018 20:48:10 > Objet: Re: New JEP: Concise Method Bodies > On Tue, Oct 9, 2018 at 11:43 AM Dan Smith < [ mail

Re: New JEP: Concise Method Bodies

2018-10-09 Thread Dan Smith
> On Oct 9, 2018, at 12:00 PM, Remi Forax wrote: > > Aside, from the semantics point of view, this is a very bad example, > implementing Comparable means you have a natural order for the class and > taking a Comparator as parameter means there is no natural order. Note that 'comp' has an initi

Re: New JEP: Concise Method Bodies

2018-10-09 Thread Remi Forax
Hi Daniel, - Mail original - > De: "daniel smith" > À: "amber-spec-experts" > Envoyé: Mardi 9 Octobre 2018 18:31:48 > Objet: Re: New JEP: Concise Method Bodies >> On Oct 8, 2018, at 12:14 PM, Dan Smith wrote: >> >> - Type-qualified

Re: New JEP: Concise Method Bodies

2018-10-09 Thread Dan Smith
> On Oct 8, 2018, at 12:14 PM, Dan Smith wrote: > > - Type-qualified method ref: if you don't pass 'this' to the method, you're > throwing it away. Static utility methods could be referenced with this form. > Methods of the current class/supers could be referenced, too, but 'this::foo' > and '

Re: New JEP: Concise Method Bodies

2018-10-08 Thread Dan Smith
> On Oct 8, 2018, at 10:50 AM, Brian Goetz wrote: > > class UnmodifiableFooWrapper implements Foo { > private final Foo underlying; > > public void fooMethod1(args) = underlying::fooMethod1; > public int fooMethod2(args) = underlying::fooMethod2; > public long

Re: New JEP: Concise Method Bodies

2018-10-08 Thread Brian Goetz
The challenge seems to be finding the right intuition. Yep.  The intent is to suggest that the behavior on the RHS is a "constant" of some sort with respect to some context, so that "assigning" it is definitional rather than mutative.  But this is still fuzzy, so we need to narrow this down

Re: New JEP: Concise Method Bodies

2018-10-05 Thread Remi Forax
> De: "daniel smith" > À: "amber-spec-experts" > Envoyé: Samedi 6 Octobre 2018 01:22:25 > Objet: Re: New JEP: Concise Method Bodies >> On Oct 5, 2018, at 4:18 PM, Brian Goetz < [ mailto:brian.go...@oracle.com | >> brian.go...@oracle.com ] > wro

Re: New JEP: Concise Method Bodies

2018-10-05 Thread Dan Smith
> On Oct 5, 2018, at 4:18 PM, Brian Goetz wrote: > >> Can the expression before the :: refer to any method parameters? Of course, >> it would still expect to pass those parameters into the method, so it's >> weird to have the same parameter used in both ways, but does it make sense >> to forbi

Re: New JEP: Concise Method Bodies

2018-10-05 Thread Remi Forax
> De: "Brian Goetz" > À: "Kevin Bourrillion" , "Alex Buckley" > > Cc: "amber-spec-experts" > Envoyé: Samedi 6 Octobre 2018 00:18:54 > Objet: Re: New JEP: Concise Method Bodies >> Can the expression before the :: refer to any me

Re: New JEP: Concise Method Bodies

2018-10-05 Thread Brian Goetz
Can the expression before the :: refer to any method parameters? Of course, it would still expect to pass those parameters into the method, so it's /weird/ to have the same parameter used in both ways, but does it make sense to forbid it? Yes, it makes sense to forbid.  Here's why. The

Re: New JEP: Concise Method Bodies

2018-10-05 Thread Remi Forax
> De: "Kevin Bourrillion" > À: "Alex Buckley" > Cc: "amber-spec-experts" > Envoyé: Vendredi 5 Octobre 2018 22:25:28 > Objet: Re: New JEP: Concise Method Bodies > Oops - sorry for the rapid-fire responses here. A couple more points while > th

Re: New JEP: Concise Method Bodies

2018-10-05 Thread Remi Forax
> De: "Kevin Bourrillion" > À: "Alex Buckley" > Cc: "amber-spec-experts" > Envoyé: Vendredi 5 Octobre 2018 22:03:53 > Objet: Re: New JEP: Concise Method Bodies > On Mon, Sep 24, 2018 at 10:17 AM Alex Buckley < [ > mailto:alex.buck...@orac

Re: New JEP: Concise Method Bodies

2018-09-25 Thread Vicente Romero
Hi all, I have published a public amber repo for the concise method bodies JEP. It can be found at [1], branch: concise-method-declarations. Also as suggested by Brian I have created a new finder, see [2]. Using it I have got some stats on the number of methods in the JDK that could potential

Re: New JEP: Concise Method Bodies

2018-09-24 Thread Alex Buckley
On 9/21/2018 4:07 PM, Kevin Bourrillion wrote: "The method reference form can use most kinds of method references after the = sign: static and unbound method references, bound method references (if the receiver *variable* is in scope for the method declaration)" Can we still bind to any expressi

Re: New JEP: Concise Method Bodies

2018-09-20 Thread Tagir Valeev
Hello, Kevin! Yes, it's a little bit hard to migrate between block body - expression body - method reference. However we already have this problem in lambdas, and we are living with this without much hassle. That's because every decent IDE can convert between these forms for you. Btw IDEA has an

Re: New JEP: Concise Method Bodies

2018-09-20 Thread Brian Goetz
I think moral-hazard arguments also deserve a bit of thought. I was thinking moral hazard too, but in the other direction.  The higher the per-method overhead, the more likely people are to write poorly factored methods and to duplicate code, because declaring another method feels too heav

Re: New JEP: Concise Method Bodies

2018-09-20 Thread Alex Buckley
On 9/20/2018 12:05 PM, Kevin Bourrillion wrote: In this case, I think the `=/` /form /might/ also clear that bar because of the automatic parameter pass-through. But I cannot currently see how the `->` form comes close to clearing it. (Data welcome.) Ooh, you know the magic words! Okay, w

Re: New JEP: Concise Method Bodies

2018-09-20 Thread Maurizio Cimadamore
On 20/09/18 20:05, Kevin Bourrillion wrote: In this case, I think the `=/` /form /might/ also clear that bar because of the automatic parameter pass-through. But I cannot currently see how the `->` form comes close to clearing it. Not sure I get it - surely every getter might benefit form thi

Re: New JEP: Concise Method Bodies

2018-09-20 Thread Kevin Bourrillion
On Wed, Sep 19, 2018 at 2:44 PM Alex Buckley wrote: On 9/19/2018 12:31 PM, Kevin Bourrillion wrote: > > In other cases, it looks like you're gaining a very /small/ amount of > > syntactic conciseness (mostly omitting `return`) and not much else? Is > > there any actual /conceptual/ simplicity or

Re: New JEP: Concise Method Bodies

2018-09-19 Thread Alex Buckley
Hi Kevin, On 9/19/2018 12:31 PM, Kevin Bourrillion wrote: In other cases, it looks like you're gaining a very /small/ amount of syntactic conciseness (mostly omitting `return`) and not much else? Is there any actual /conceptual/ simplicity or clarity being gained? Let me focus on the single ex

Re: New JEP: Concise Method Bodies

2018-09-19 Thread Alex Buckley
e removed Rémi - Mail original - De: "mark reinhold" À: "Alex Buckley" Cc: "amber-spec-experts" Envoyé: Mercredi 19 Septembre 2018 20:54:46 Objet: Re: New JEP: Concise Method Bodies 2018/9/19 11:42:16 -0700, alex.buck...@oracle.com: https://bugs.openjdk.java.net/browse/JDK-8209434 Or, more readably: http://openjdk.java.net/jeps/8209434 - Mark

Re: New JEP: Concise Method Bodies

2018-09-19 Thread Remi Forax
oops, no, the ';' is necessary here, sorry. Rémi - Mail original - > De: "Remi Forax" > À: "mark reinhold" > Cc: "amber-spec-experts" > Envoyé: Mercredi 19 Septembre 2018 21:40:41 > Objet: Re: New JEP: Concise Method Bodies >

Re: New JEP: Concise Method Bodies

2018-09-19 Thread Remi Forax
reinhold" > À: "Alex Buckley" > Cc: "amber-spec-experts" > Envoyé: Mercredi 19 Septembre 2018 20:54:46 > Objet: Re: New JEP: Concise Method Bodies > 2018/9/19 11:42:16 -0700, alex.buck...@oracle.com: >> https://bugs.openjdk.java.net/browse/JDK-8209434 > > Or, more readably: http://openjdk.java.net/jeps/8209434 > > - Mark

Re: New JEP: Concise Method Bodies

2018-09-19 Thread mark . reinhold
2018/9/19 11:42:16 -0700, alex.buck...@oracle.com: > https://bugs.openjdk.java.net/browse/JDK-8209434 Or, more readably: http://openjdk.java.net/jeps/8209434 - Mark

New JEP: Concise Method Bodies

2018-09-19 Thread Alex Buckley
https://bugs.openjdk.java.net/browse/JDK-8209434