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
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
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.
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
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
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
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:
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
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
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
> 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
>
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
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,
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"
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.
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,
16 matches
Mail list logo