> De: "John Rose" <john.r.r...@oracle.com> > À: "Remi Forax" <fo...@univ-mlv.fr> > Cc: "Brian Goetz" <brian.go...@oracle.com>, "amber-spec-experts" > <amber-spec-experts@openjdk.java.net> > Envoyé: Samedi 13 Octobre 2018 07:00:09 > Objet: Re: `this` in concise method bodies
> On Oct 12, 2018, at 12:58 PM, Remi Forax < [ mailto:fo...@univ-mlv.fr | > fo...@univ-mlv.fr ] > wrote: >> 1) They are few methods that can be converted to concise methods because the >> implementation has to be a one liner, >> 2) They are very few methods that can be converted to a concise methods that >> that use the :: syntax because it only works if the implementation delegates >> to >> a method that uses all the parameters in the same order, >> 3) They are very very few methods that can be converted to a concise methods >> that use the :: and use 'this' explicitly as first parameter. >> so before descending into the rabbit hole, i think not me|someone should >> check >> how many methods can be converted to use the :: + this syntax in big corpus >> of >> Java codes. > This is probably true, because Java programmers have limited tools > for software reuse: Inheritance and explicit subroutine calls. If they > had the ability to connect methods directly using CMBs, the source > base would look different. There would be less cut-and-paste. A true > mechanical analysis of the applicability of CMBs to connect methods > would have to disregard lots of hand-crafted of method calls, and > unwind uses of inheritance where delegation (had it been available > at the time) would have been a better choice. I agree, contrasting the code of java.util.stream with the code of the collection of java.util see that having for me, this is a rational to introduce (2), we want to offer a syntax to