Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 30F49200BB3 for ; Wed, 19 Oct 2016 02:33:39 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 2F9A9160AF7; Wed, 19 Oct 2016 00:33:39 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 043DF160AE5 for ; Wed, 19 Oct 2016 02:33:37 +0200 (CEST) Received: (qmail 79159 invoked by uid 500); 19 Oct 2016 00:33:37 -0000 Mailing-List: contact dev-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@groovy.apache.org Delivered-To: mailing list dev@groovy.apache.org Received: (qmail 79143 invoked by uid 99); 19 Oct 2016 00:33:36 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Oct 2016 00:33:36 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 22551C0FB9 for ; Wed, 19 Oct 2016 00:33:36 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 5.572 X-Spam-Level: ***** X-Spam-Status: No, score=5.572 tagged_above=-999 required=6.31 tests=[FORGED_HOTMAIL_RCVD2=1.187, HTML_MESSAGE=2, KAM_UNSUB1=0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_SOFTFAIL=0.972, URI_HEX=1.313] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 1ejpQjMTn7DV for ; Wed, 19 Oct 2016 00:33:34 +0000 (UTC) Received: from mbob.nabble.com (mbob.nabble.com [162.253.133.15]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id D26665FD0A for ; Wed, 19 Oct 2016 00:33:33 +0000 (UTC) Received: from static.162.255.23.22.macminivault.com (unknown [162.255.23.22]) by mbob.nabble.com (Postfix) with ESMTP id 60BF033FA9AD for ; Tue, 18 Oct 2016 17:26:59 -0700 (PDT) Date: Tue, 18 Oct 2016 17:33:32 -0700 (MST) From: daniel_sun To: dev@groovy.incubator.apache.org Message-ID: In-Reply-To: References: <1476718854771-5736169.post@n5.nabble.com> <58065EF3.80504@gmx.org> Subject: Re: Lambda expression for Groovy 3 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_20598_1734322788.1476837212785" archived-at: Wed, 19 Oct 2016 00:33:39 -0000 ------=_Part_20598_1734322788.1476837212785 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thanks :) Guillaume, is there a road map to show us the plan of Groovy3? e.g. when to= release the first beta version and what feature should be included? Cheers, Daniel.Sun =E5=9C=A8 "Guillaume Laforge [via Groovy]" =EF=BC=8C2016=E5=B9=B410=E6=9C=8819=E6=97=A5 =E4=B8=8A=E5=8D=887:= 47=E5=86=99=E9=81=93=EF=BC=9A Thanks for the explanations! (and great achievement!) On Wed, Oct 19, 2016 at 1:43 AM, daniel_sun <[hidden email]> wrote: To be exact, lambda expression of Groovy enhances the syntax of Java lambda= expression, e.g. lambda expression of Java is not callable. Cheers, Daniel.Sun =E5=9C=A8 "Remi Forax [via Groovy]" =EF=BC=8C2016= =E5=B9=B410=E6=9C=8819=E6=97=A5 =E4=B8=8A=E5=8D=884:36=E5=86=99=E9=81=93=EF= =BC=9A I would say Groovy Closure with the Java syntax. R=C3=A9mi On October 18, 2016 8:21:34 PM GMT+02:00, Guillaume Laforge <[hidden email]= > wrote: Is it actually Groovy closures? or "real" Java lambdas? On Tue, Oct 18, 2016 at 7:42 PM, Jochen Theodorou <[hidden email]> wrote: hah, I knew you can do it ;) On 18.10.2016 18:34, daniel_sun wrote: Jochen, lambda expression is fully supported now :) https://github.com/danielsun1106/groovy-parser/commit/c380e4230ecef350855b9= f56a220411635a7ff87 https://github.com/danielsun1106/groovy-parser/blob/master/src/test/resourc= es/core/Lambda_01x.groovy Cheers, Daniel.Sun =E5=9C=A8 "Jochen Theodorou [via Groovy]" >=EF=BC=8C2016=E5=B9= =B410=E6=9C=8818=E6=97=A5 00:37 =E5=86=99=E9=81=93=EF=BC=9A On 17.10.2016 17:40, daniel_sun wrote: > Hi all, > > Lambda expression for Groovy has been completed with a little > limitation, which is due to the existing closure whose parameter list can be > ambiguous to lambda expression, e.g. {a -> a} which can be parsed as a > lambda expression in a block, but we expect it a closure. I think that limitation is ok > In order to > resolve the ambiguities, the parentheses for parameters is a must, e.g. > *Java8* allows parentheses-less parameter for lambda when the parameter is > single and without type: e -> e, but *Groovy* only allows parameter with > parentheses: (e) -> e. > > *Here are some examples for lambda expression for Groovy:* > assert 9 =3D=3D [1, 2, 3].stream().map((e) -> e + 1).reduce(0, (r, e= ) -> r + e) which means you cannot write > assert 9 =3D=3D [1, 2, 3].stream().map(e -> e + 1).reduce(0, (r, e) -> r + e) which I find not so ok. Here again it would be no problem if it is recognized as Closure if that is more easy to accomplish. bye Jochen -----------------------------------------------------------------------= - If you reply to this email, your message will be added to the discussion below: http://groovy.329449.n5.nabble.com/Lambda-expression-for-Groovy-3-tp573= 6169p5736171.html To unsubscribe from Lambda expression for Groovy 3, click here. NAML ------------------------------------------------------------------------ View this message in context: Re: Lambda expression for Groovy 3 Sent from the Groovy Dev mailing list archive at Nabble.com. -- Guillaume Laforge Apache Groovy committer & PMC Vice-President Developer Advocate @ Google Cloud Platform Blog: http://glaforge.appspot.com/ Social: @glaforge / Google+ -- Sent from my Android device with K-9 Mail. Please excuse my brevity. ________________________________ If you reply to this email, your message will be added to the discussion be= low: http://groovy.329449.n5.nabble.com/Lambda-expression-for-Groovy-3-tp5736169= p5736179.html To unsubscribe from Lambda expression for Groovy 3, click here. NAML ________________________________ View this message in context: Re: Lambda expression for Groovy 3 Sent from the Groovy Dev mailing list archive at Nabble.com. -- Guillaume Laforge Apache Groovy committer & PMC Vice-President Developer Advocate @ Google Cloud Platform Blog: http://glaforge.appspot.com/ Social: @glaforge / Google+ ________________________________ If you reply to this email, your message will be added to the discussion be= low: http://groovy.329449.n5.nabble.com/Lambda-expression-for-Groovy-3-tp5736169= p5736185.html To unsubscribe from Lambda expression for Groovy 3, click here. NAML -- View this message in context: http://groovy.329449.n5.nabble.com/Lambda-exp= ression-for-Groovy-3-tp5736169p5736188.html Sent from the Groovy Dev mailing list archive at Nabble.com. ------=_Part_20598_1734322788.1476837212785 Content-Type: text/html; charset=UTF8 Content-Transfer-Encoding: quoted-printable
Thanks :)
Guillaume, is there a road map to show us the plan of Groo= vy3? e.g. when to release the first beta version and what feature should be= included?

Cheers,
Daniel.Sun



=E5=9C=A8 "Guillaume Laforge [via Groovy]&q= uot; <ml-node+[hidden email= ]>=EF=BC=8C2016=E5=B9=B410=E6=9C=8819=E6=97=A5 =E4=B8=8A=E5=8D=887:4= 7=E5=86=99=E9=81=93=EF=BC=9A

Thanks for the explanations!
(and great achievement!)

On Wed, Oct 19, 2016 at 1:43 AM, daniel_sun <[hidd= en email]> wrote:
To be exact, lambda expression of Groovy enhances the synt= ax of Java lambda expression,  e.g. lambda expression of Java is not c= allable.

Cheers,
Daniel.Sun



=E5=9C=A8 "Remi Forax = [via Groovy]" <ml-node+[hidden email]>=EF=BC=8C2016=E5=B9=B410= =E6=9C=8819=E6=97=A5 =E4=B8=8A=E5=8D=884:36=E5=86=99=E9=81=93=EF=BC=9A

I would say Groovy Closure with the Java syntax.

R=C3=A9mi

On October 18, 2016 8:21:34 PM = GMT+02:00, Guillaume Laforge <[hidden email]> wrote:
Is it actually Groovy closures? or "real" Java l= ambdas?

On Tue, Oct 18, 2016 at 7:42 PM, Jochen Theodoro= u <[hidden email]> wrote:

hah, I knew you can do it ;)

On 18.10.2016 18:34, daniel_sun wrote:
Jochen, lambda expression is fully supported now :)

https://github.com/danielsun1106/groovy-parser/commit/c380e4230ec= ef350855b9f56a220411635a7ff87

https://github.com/danielsun1106/groovy-parser/blob/master/= src/test/resources/core/Lambda_01x.groovy


Cheers,
Daniel.Sun



=E5=9C=A8 "Jochen Theodorou [via Groovy]" <ml-node+[hidden= email]
</user/SendEmail.jtp?type=3Dnode&node=3D5736176&i=3D0>= >=EF=BC=8C2016=E5=B9=B410=E6=9C=8818=E6=97=A5 00:37

=E5=86=99=E9=81=93=EF=BC=9A



    On 17.10.2016 17:40, daniel_sun wrote:
     > Hi all,
     >
     >        Lambda expression for G= roovy has been completed with a little
     > limitation, which is due to the existing closure w= hose parameter
    list can be
     > ambiguous to lambda expression, e.g. {a -> a} w= hich can be parsed
    as a
     > lambda expression in a block, but we expect it a c= losure.

    I think that limitation is ok

     > In order to
     > resolve the ambiguities, the parentheses for param= eters is a
    must, e.g.
     > *Java8* allows parentheses-less parameter for lamb= da when the
    parameter is
     > single and without type: e -> e, but *Groovy* o= nly allows
    parameter with
     > parentheses: (e) -> e.
     >
     >        *Here are some examples= for lambda expression for Groovy:*
     > assert 9 =3D=3D [1, 2, 3].stream().map((e) -> e= + 1).reduce(0, (r, e)
    -> r + e)

    which means you cannot write
     > assert 9 =3D=3D [1, 2, 3].stream().map(e -> e &= #43; 1).reduce(0, (r, e)
    -> r + e)

    which I find not so ok. Here again it would be no problem if = it is
    recognized as Closure if that is more easy to accomplish.

    bye Jochen


    -------------------------------------------------------------= -----------
    If you reply to this email, your message will be added to the=
    discussion below:
    http://groovy.329449.n5.nabble.com/Lambda-expression-for-Groovy-3-tp5736169= p5736171.html

    To unsubscribe from Lambda expression for Groovy 3, click her= e.
    NAML
    <http://groovy.329449.n5.nabble.com/template/= NamlServlet.jtp?macro=3Dmacro_viewer&id=3Dinstant_html%21nabble%3Aemail= .naml&base=3Dnabble.naml.namespaces.BasicNamespace-nabble.view.web.temp= late.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs= =3Dnotify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail= .naml-send_instant_email%21nabble%3Aemail.naml>



------------------------------------------------------------------------
View this message in context: Re: Lambda expression for Groovy 3
<http://groovy.329449.n5.nabble.com/Lambda-expression-for-Gro= ovy-3-tp5736169p5736176.html>
Sent from the Groovy Dev mailing list archive
<http://groovy.3= 29449.n5.nabble.com/Groovy-Dev-f372993.html> at Nabble.com.




--
Guillaume Laforge
Apache Groovy committer & PMC Vice-President
Developer Advocate @ Google Cloud Platform


--
Sent from my Android device with K-9 Mail. Please excuse my brevity.


If you reply to this email, your message wi= ll be added to the discussion below:
http://groovy.329449.n5.nabble.com/Lambda-expression-for-Groovy-= 3-tp5736169p5736179.html
To unsubscribe from Lambda expression for Groovy 3, click here.
NAML


View this message in context: Re: Lambda expression for Groovy 3
Sent from the Groovy Dev mailing list archive at Nabble.com.



--
Guillaume Laforge
Apache Groovy committer & PMC Vice-President
Developer Advocate @ Google Cloud Platform




If you reply to this email, your message wi= ll be added to the discussion below:
http://groovy.329449.n5.nabble.com/Lambda-expression-for-Groovy-3-tp573= 6169p5736185.html
To unsubscribe from Lambda expression for Groovy 3, click here.
NAML
=09 =09 =09

View this message in context: Re: Lambda expressi= on for Groovy 3
Sent from the Groovy Dev mailing list archive at Nabble.com.
------=_Part_20598_1734322788.1476837212785--