From dev-return-7263-archive-asf-public=cust-asf.ponee.io@groovy.apache.org Thu Feb 11 10:28:21 2021 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mxout1-ec2-va.apache.org (mxout1-ec2-va.apache.org [3.227.148.255]) by mx-eu-01.ponee.io (Postfix) with ESMTPS id 35FD018065D for ; Thu, 11 Feb 2021 11:28:21 +0100 (CET) Received: from mail.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mxout1-ec2-va.apache.org (ASF Mail Server at mxout1-ec2-va.apache.org) with SMTP id 7023E44857 for ; Thu, 11 Feb 2021 10:28:20 +0000 (UTC) Received: (qmail 36508 invoked by uid 500); 11 Feb 2021 10:28:20 -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 36496 invoked by uid 99); 11 Feb 2021 10:28:19 -0000 Received: from spamproc1-he-de.apache.org (HELO spamproc1-he-de.apache.org) (116.203.196.100) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Feb 2021 10:28:19 +0000 Received: from localhost (localhost [127.0.0.1]) by spamproc1-he-de.apache.org (ASF Mail Server at spamproc1-he-de.apache.org) with ESMTP id 16AAA1FF39A for ; Thu, 11 Feb 2021 10:28:19 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamproc1-he-de.apache.org X-Spam-Flag: NO X-Spam-Score: 0.22 X-Spam-Level: X-Spam-Status: No, score=0.22 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.2, RCVD_IN_MSPIKE_H2=-0.001, SPF_NONE=0.001, T_KAM_HTML_FONT_INVALID=0.01, T_REMOTE_IMAGE=0.01] autolearn=disabled Authentication-Results: spamproc1-he-de.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=asert-com-au.20150623.gappssmtp.com Received: from mx1-ec2-va.apache.org ([116.203.227.195]) by localhost (spamproc1-he-de.apache.org [116.203.196.100]) (amavisd-new, port 10024) with ESMTP id GCiurcyTvqIX for ; Thu, 11 Feb 2021 10:28:17 +0000 (UTC) Received-SPF: None (mailfrom) identity=mailfrom; client-ip=209.85.128.46; helo=mail-wm1-f46.google.com; envelope-from=paulk@asert.com.au; receiver= Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by mx1-ec2-va.apache.org (ASF Mail Server at mx1-ec2-va.apache.org) with ESMTPS id 47B5BBCC6B for ; Thu, 11 Feb 2021 10:28:17 +0000 (UTC) Received: by mail-wm1-f46.google.com with SMTP id u16so1401911wmq.1 for ; Thu, 11 Feb 2021 02:28:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=asert-com-au.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to; bh=tyq8bzWug1YsxisqFRvA0g3YJqDTZCNMi9TaWVI+wco=; b=USwB1cU8gsRNzQZI6muU3/hEFsbbiPh6h+YDIyLNq2QBiv90BdjF5PQbMff+6pxbpA JHJ7eA6gKt+zgGu8owoPSrvAJmPNrJJZkAFmCeikChBMadup7jvCxC+Kqqbuc7uAOpSA /yBDDzINIYZZr1W/a7JsBdXTczHbpyfRV6Nz0rWq0Fwe6gwkopEACMaFiQdEkk1K8JGJ 6ke3SVXPTFZuHPd3ZDo2WuFzue93nN4HRO9E5Mu0QXO1U28gZtkapWMvwRSgvWVe8SX1 NYZ/dywk+bv+P6zmUJFoFUHOznBSne5QZy81qiGpDDRsO1NyK8ZwbVHaDY50ZgghkRlU t3MQ== 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:reply-to :from:date:message-id:subject:to; bh=tyq8bzWug1YsxisqFRvA0g3YJqDTZCNMi9TaWVI+wco=; b=uJi08eoNuYamNXKVFWCjdO4BOFaqmHQRoRaOr9A6aypz2o7z1WalQ3gAgRYfzY6S7c 8oVSWf7hyhh7uKl8/Agdavlkiol41IrJuaLm7i5shgTL6qvHFGIe6iZv87WW8xwBhXNC hEpewOwfcfeNbCs6+nuqbkjdc5vwsy0Q0uuMymjGwl4Ue7L31Z9BI7lwRlv4Dx0H2EJV fDrs0gp9BxjLUAVpUbQ1U9eAh8VJFi9pg6481eOoq3vxvfFvll5SlU5omWF4WL8R2gcV Td0AZoxnMx3If4R/7LMqiwxlbIQsBYrV+nSQQ1GRvi9oSWrEAM4HUcCk1f9Nf9S0eABH LGvA== X-Gm-Message-State: AOAM531LTDfoGDQpQJMo/BMTHTp40HszY3Dx5KwKNAjPuSM7zWvehgfl NpHQztfieSLGvGp8Mcm2v1SPYS9BT1+B5nL/RJly58/YbrOfPw== X-Google-Smtp-Source: ABdhPJzFC88DvZz/9H48oOmqGfhMjbNxu+u95sqZaAWqVNY7AEpnGamSxywwM0Nz70C8Is/G5qOMUm/WWeZNRRpx8dY= X-Received: by 2002:a1c:7f83:: with SMTP id a125mr4413031wmd.141.1613039296181; Thu, 11 Feb 2021 02:28:16 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Reply-To: paulk@asert.com.au From: Paul King Date: Thu, 11 Feb 2021 20:28:05 +1000 Message-ID: Subject: Re: Proposal handling of potential variable declarations for expressions starting with an underscore or dollar To: Groovy_Developers Content-Type: multipart/alternative; boundary="000000000000420bda05bb0cfa6f" --000000000000420bda05bb0cfa6f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Yes, single underscore is restricted in Java the language but not as far as I know at the JVM specification level. I don't believe the leading underscore case is impacted at all by the single case. My understanding is that Java is pathing the way for how underscore is used in other languages, e.g. "_" could be used where we currently use "it" or where ignored parameters/variables might come into play. E.g. Scala allows "List(1, 2, 3) foreach println _". We certainly have further decisions to make around the single underscore in Groovy, e.g. we could support "def (_, ycoord, _) =3D getCoords3D()". But again, I see no impact on leading underscores. Cheers, Paul. On Thu, Feb 11, 2021 at 8:08 PM Andres Almiray wrote: > As I recall the use of a single _ as variable name is restricted since > JDK10 and will become an error in newer JDKs. > > Does the use of a leading _ in an identifier has been discouraged as well > in newer JDKs? If so then we should do the same even of means breaking > compatibility. > > Cheers > Andres > > Sent from my primitive tricorder > > On 11 Feb 2021, at 10:58, Mario Garcia wrote: > > =EF=BB=BF > If it helps, I've seen some programmers with python background using the > underscore in Groovy for method declaration. It seems they use the > convention of the underscore prefix to note these methods aren't for publ= ic > consumption. > > El jue, 11 feb 2021 a las 9:49, Paul King () > escribi=C3=B3: > >> >> Hi folks, >> >> I would be interested in any thoughts about the following issue: >> >> https://issues.apache.org/jira/browse/GROOVY-9936 >> >> TL;DR There is an edge case where Groovy 3 (Parrot) behavior now differs >> from the old parser. Even though an argument could be made either way as= to >> which behavior is better, I propose we align with the old parser. >> >> Proposed PR: >> >> https://github.com/apache/groovy/pull/1485 >> >> Let me know your thoughts. >> >> Thanks, Paul. >> >> >> >> Virus-free. >> www.avast.com >> >> <#m_-1318158497720742238_m_-5064115683895307916_DAB4FAD8-2DD7-40BB-A1B8-= 4E2AA1F9FDF2> >> > --000000000000420bda05bb0cfa6f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Yes, single underscore is = restricted in Java the language but not as far as I know at the JVM specifi= cation level.

I don't believe the leading unde= rscore case is impacted at all by the single case. My understanding is that= Java is pathing the way for how underscore is used in other languages, e.g= . "_" could be used where we currently use "it" or wher= e ignored parameters/variables might come into play. E.g. Scala allows &quo= t;List(, 2, 3) foreach println _".

We certainly have furth= er decisions to make around the single underscore in Groovy, e.g. we could = support "def (_, ycoord, _) =3D getCoords3D()". But again, I see = no impact on leading underscores.

Cheers, Paul.


On Thu, Feb 11, 2021 at 8:08 PM Andres Almira= y <aalmiray@gmail.com> wrot= e:
As I recall the use of a single _ as variable name is restricted since= JDK10 and will become an error in newer JDKs.=C2=A0

Doe= s the use of a leading _ in an identifier has been discouraged as well in n= ewer JDKs? If so then we should do the same even of means breaking compatib= ility.=C2=A0

Cheers
Andres

Sent from my primitive tricorder

On 11 Feb 2021, at 10:58, Mario Garcia <mario.ggar@gmail.com>= wrote:

=EF=BB=BF
If it helps, I&#= 39;ve seen some programmers with python background using the underscore in = Groovy for method declaration. It seems they use the convention of the unde= rscore prefix to note these methods aren't for public consumption.

El jue, 11 feb 2021 a las 9:49, Paul King (<paul.king.asert@gmail.com>) escr= ibi=C3=B3:

Hi folks,

I would be interest= ed in any thoughts about the following issue:

<= br>
TL;DR There is an edge case where Groovy 3 (Parrot) beh= avior now differs from the old parser. Even though an argument could be mad= e either way as to which behavior is better, I propose we align with the ol= d parser.

Proposed PR:

Let me know yo= ur thoughts.

Thanks, Paul.


3D"" Virus-free. www.avast.com
--000000000000420bda05bb0cfa6f--