From dev-return-5347-archive-asf-public=cust-asf.ponee.io@groovy.apache.org Sat Sep 8 13:26:07 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id A8224180621 for ; Sat, 8 Sep 2018 13:26:06 +0200 (CEST) Received: (qmail 59892 invoked by uid 500); 8 Sep 2018 11:26:05 -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 59882 invoked by uid 99); 8 Sep 2018 11:26:05 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 08 Sep 2018 11:26:05 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id A4852C06C1 for ; Sat, 8 Sep 2018 11:26:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.379 X-Spam-Level: ** X-Spam-Status: No, score=2.379 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, KAM_NUMSUBJECT=0.5, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, T_DKIMWL_WL_MED=-0.01, T_KAM_HTML_FONT_INVALID=0.01] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id CPn7cjuflTOJ for ; Sat, 8 Sep 2018 11:26:02 +0000 (UTC) Received: from mail-oi0-f50.google.com (mail-oi0-f50.google.com [209.85.218.50]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 828205F16A for ; Sat, 8 Sep 2018 11:26:01 +0000 (UTC) Received: by mail-oi0-f50.google.com with SMTP id y207-v6so31876409oie.13 for ; Sat, 08 Sep 2018 04:26:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6xeQFLrSsB6yqopJ8l/8M5OKVYdxp0UDGoQfnAsV7G4=; b=NJt4cDHP7rFSr4eGZqlVYzzSIg0IzJeRA1h3MywoJrb1AzdFu4a7v0H372BZmsJO2j gckZxjB1V2EuTsobwdr0JoeXjPVk6k7HWxFgRcN9vilgaWwzIWZsSWRauViYzuZZ286h yMgy9Gs1yesAdOkzv8bjjir/chJop8/zrVLxqfcaVS9ssV+e4RUvcMqUMFyq+hHz1lex zLx0gvzKSIlpksDOuSQhLHbUFq3cRePvSzcKDCPQAnY5RlFU5jfF4XkPujZIJWRZc3fF XOiCQErXWpS4OcIfmPV7I1lmw2keLhrBjV7uijBjCGWQcGorrppRV9lSzRxbhOamQfb3 2yFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6xeQFLrSsB6yqopJ8l/8M5OKVYdxp0UDGoQfnAsV7G4=; b=BKfaylhIEfUJg6nGBzhyZo764KGZhBKC20F9V/gRLZNY6CY7kEcw3v4MdK3ONRmhv0 FBdRQqSA8Pc51JAfFu7pbuVN1+h6DjUYlJf297h3hgP04r5Nhpn73n6PSP/vwGRTL+N2 KvWgh7IY5VHQ37/jZYj38wn4CHiblkbl6qxBMCK31cFEYf+j9McULF5vagwEYFQNmNok +p0R0kwlvOM/lDpLRzhZGseaiAZ22L8/diBeUG5lPM/2gYS4feC4pE3rW/dTCXhv0SmB B/HnIXFBaUQ/ok9gmIAJJSloCKQtQYW2O3BFz3HQtnabNZJ7uKC2nuciAEAme58Fdsdu T3TQ== X-Gm-Message-State: APzg51CuWKzCSsVR3E7iq81lIC/1KvSaL7oaH80vHR8m/eduyPz2H+iA wNirwbDIvOYBt9Guqxi8O013ZI+QQGEPXjsy8BEN64hW X-Google-Smtp-Source: ANB0VdZw4N8QYYrbHIs+e5kvUotZFwksSKHGlqVuOtyR+NL1Sa3jk2zZEQa7hU2ixkZi0xkHbPIDkOZPhXmaBWDljFY= X-Received: by 2002:aca:af11:: with SMTP id y17-v6mr11872667oie.274.1536405959953; Sat, 08 Sep 2018 04:25:59 -0700 (PDT) MIME-Version: 1.0 References: <1536368845803-0.post@n5.nabble.com> <1536380598988-0.post@n5.nabble.com> In-Reply-To: <1536380598988-0.post@n5.nabble.com> From: Paolo Di Tommaso Date: Sat, 8 Sep 2018 13:25:23 +0200 Message-ID: Subject: Re: [Proposal] GString is implemented eager and treated as normal String since groovy 3.0.0 To: dev@groovy.apache.org Cc: dev@groovy.incubator.apache.org Content-Type: multipart/alternative; boundary="00000000000079545105755a6317" --00000000000079545105755a6317 Content-Type: text/plain; charset="UTF-8" I would like to raise a flag here. Stated the Groovy documentation a Gstring can be resolved both in a eager and lazy manner: def number = 1 def eagerGString = "value == ${number}"def lazyGString = "value == ${ -> number }" assert eagerGString == "value == 1" assert lazyGString == "value == 1" number = 2 assert eagerGString == "value == 1"assert lazyGString == "value == 2" http://groovy-lang.org/syntax.html#_special_case_of_interpolating_closure_expressions The example you are reporting should *already* be reasolved eagerly and I can agree that it can be confusing. However the ability to resolve a GString lazily it's a very important Groovy feature for DSL builders. Wipe it out would have a serious impact (read destroy) on existing frameworks that rely on that feature. Cheers, Paolo --00000000000079545105755a6317 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I would like to raise a = flag here.=C2=A0=C2=A0

Stated the Groovy documentation a= Gstring can be resolved both in a eager and lazy manner:=C2=A0
<= br>
def number =3D<=
span class=3D"gmail-pln" style=3D"box-sizing:border-box;color:rgb(0,0,0)"> =
1 
def eagerGString =3D "val=
ue =3D=3D ${number}"
def lazyGString =3D "value =
=3D=3D ${ -> number }"

assert eagerGString =3D=3D &quo=
t;value =3D=3D 1" 
assert lazyGString =3D=3D  &qu=
ot;value =3D=3D 1" 

number =3D 2 
assert eagerGString=
 =3D=3D  "value =3D=3D 1"
assert lazyGString =3D=3D "va=
lue =3D=3D 2"



The example you are reporti= ng should *already* be reasolved eagerly and I can agree that it can be con= fusing.=C2=A0

However the ability to resolve a GSt= ring lazily it's a very important Groovy feature for DSL builders. Wipe= it out would have a serious impact (read destroy) on existing frameworks t= hat rely on that feature.=C2=A0


Cheers,
Paolo
--00000000000079545105755a6317--