Re: getting in line for the releases of groovy 2.4.8 and 2.5.0-beta-1

2016-10-19 Thread Guillaume Laforge
Mario, did you try the WIP by Daniel Sun, to provide feedback, see how it works on your code base? That's also a way to help and assess how far we are from having the new parser ready, if you've got a bit of time to try it out. On Wed, Oct 19, 2016 at 6:11 PM, Mario Garcia

Re: Lambda expression for Groovy 3

2016-10-19 Thread Cédric Champeau
First of all, great work, Daniel ! I'm confident that making the "lambdas" be "closures" in Groovy is enough. I stated it in the past but I'm going to repeat myself here, I don't think having 2 syntax for "closures/lambdas" with slightly different semantics would help our users/language. That

Re: Lambda expression for Groovy 3

2016-10-19 Thread Cédric Champeau
2016-10-19 10:51 GMT+02:00 Jochen Theodorou : > > > On 19.10.2016 09:09, Cédric Champeau wrote: > >> First of all, great work, Daniel ! I'm confident that making the >> "lambdas" be "closures" in Groovy is enough. >> > > I think it won't be enough for :: and MethodClosures.

Re: Lambda expression for Groovy 3

2016-10-19 Thread Guillaume Laforge
That's what I thought too. Although there's one :: case that .& doesn't support in Groovy. (details escape me at this point as I'm in a hurry to go & grab lunch :D) On Wed, Oct 19, 2016 at 12:23 PM, daniel_sun wrote: > Hi Jochen, > > I plan to map Java's *::* to

Re: Lambda expression for Groovy 3

2016-10-19 Thread Jesper Steen Møller
Hi Daniel Be careful with that approach, as it won’t work for static methods — leading to very different semantics for the two languages. Also, you won’t be able to support constructor references without some new AST construct, I guess. -Jesper > On 19. okt. 2016, at 12.23, daniel_sun

Re: Lambda expression for Groovy 3

2016-10-19 Thread Remi Forax
Daniel, you have also to test that Type::method work not only with static methods but also with instance method. The awful case being when you have a static method that takes an instance in parameter that 'overload' an instance method, like Integer.toString() and Integer.toString(int). Rémi

答复: Lambda expression for Groovy 3

2016-10-19 Thread daniel_sun
Hi Rémi, Groovy can choose the right method to call :) assert ['1', '2', '3'] == [1, 2, 3].collect(Integer.) Cheers, Daniel.Sun 发件人: Remi Forax [via Groovy] 发送时间: 2016年10月19日 19:29 收件人: daniel_sun 主题: Re:

Re: Lambda expression for Groovy 3

2016-10-19 Thread Jochen Theodorou
On 19.10.2016 09:09, Cédric Champeau wrote: First of all, great work, Daniel ! I'm confident that making the "lambdas" be "closures" in Groovy is enough. I think it won't be enough for :: and MethodClosures. Actually, Daniel, are those supported in the new Grammar and what are they mapped

Re: Lambda expression for Groovy 3

2016-10-19 Thread Paul King
On Wed, Oct 19, 2016 at 8:25 PM, Guillaume Laforge wrote: > That's what I thought too. > Although there's one :: case that .& doesn't support in Groovy. > (details escape me at this point as I'm in a hurry to go & grab lunch :D) I think these are the references you had in

Re: Lambda expression for Groovy 3

2016-10-19 Thread Remi Forax
Hi Cedric, > De: "Cédric Champeau" > À: dev@groovy.apache.org > Envoyé: Mercredi 19 Octobre 2016 09:09:51 > Objet: Re: Lambda expression for Groovy 3 > First of all, great work, Daniel ! I'm confident that making the "lambdas" be > "closures" in Groovy is enough. I

Re: Lambda expression for Groovy 3

2016-10-19 Thread forax
> De: "Jesper Steen Møller" > À: dev@groovy.apache.org > Cc: "Remi Forax" > Envoyé: Mercredi 19 Octobre 2016 01:15:47 > Objet: Re: Lambda expression for Groovy 3 > "Real lambdas" with the full invokedynamic treatment is a big job, and > requires >

Re: Lambda expression for Groovy 3

2016-10-19 Thread daniel_sun
Hi Jesper, > Be careful with that approach, as it won’t work for static methods — > leading to very different semantics for the two languages. '.&' can reference the static methods, here is the sample code: [1, 2, 3].each(Objects.) > Also, you won’t be able to

Re: Lambda expression for Groovy 3

2016-10-19 Thread daniel_sun
Hi Jochen, I plan to map Java's *::* to Groovy's *.&*, the following code is ok now. What do you think about it? [1, 2, 3].stream().forEach(System.out.) // object method, [1, 2, 3].stream().forEach(System.out::println) [1, 2, 3].stream().forEach(Objects.) // class method, [1, 2,

Re: Lambda expression for Groovy 3

2016-10-19 Thread Jochen Theodorou
On 19.10.2016 12:26, Cédric Champeau wrote: 2016-10-19 10:51 GMT+02:00 Jochen Theodorou >: On 19.10.2016 09:09, Cédric Champeau wrote: First of all, great work, Daniel ! I'm confident that making the "lambdas" be "closures"

Re: Lambda expression for Groovy 3

2016-10-19 Thread Jochen Theodorou
On 19.10.2016 12:34, Jesper Steen Møller wrote: Hi Daniel Be careful with that approach, as it won’t work for static methods — leading to very different semantics for the two languages. Also, you won’t be able to support constructor references without some new AST construct, I guess.

Re: Lambda expression for Groovy 3

2016-10-19 Thread Jochen Theodorou
On 19.10.2016 12:23, daniel_sun wrote: Hi Jochen, I plan to map Java's *::* to Groovy's *.&*, the following code is ok now. What do you think about it? [1, 2, 3].stream().forEach(System.out.) // object method, [1, 2, 3].stream().forEach(System.out::println) [1, 2,