About supporting `var` of Java10+

2018-03-07 Thread Daniel Sun
Hi all, As GROOVY-8498[1] describes as follows, in order to compatibility with Java 10+, Groovy should support `var` the reserved type name. The reference implementation has been pushed to master and 2.6.0 branch, you can find it via the link[2]. Any thoughts? *GROOVY-8498:* ``` This is

Re: About supporting `var` of Java10+

2018-03-07 Thread MG
Hi Daniel, I agree that it does not make much sense to closely mirror the details of the Java specifications in Groovy, but I still think that simply treating var the same as def looses some potential for the static compilation case, e.g.: var myVar = new Foo() myVar = 123 // Allowed when

Re: GPars and versions of Groovy

2018-03-07 Thread Russel Winder
On Tue, 2018-03-06 at 23:19 +0100, Jochen Theodorou wrote: > On 06.03.2018 16:51, Russel Winder wrote: > > Hi, > > > > Currently the GPars build system assumes one and only one version > > of > > Groovy. Currently we have four, most likely incompatible, versions > > of > > Groovy on the boil:

Re: GPars and versions of Groovy

2018-03-07 Thread Russel Winder
On Tue, 2018-03-06 at 20:15 +0100, Jim Northrop wrote: > Thanks to you for this - > > Does this mean that GPars will no longer work on JDK1.7 ? What is the > minimum jdk that we require for GPars, please ? > Thx > Jim > GPars 2.0 requires JDK8 or later. I am not interested in doing anything

Re: About supporting `var` of Java10+

2018-03-07 Thread Jochen Theodorou
On 08.03.2018 02:23, MG wrote: Hi Daniel, I agree that it does not make much sense to closely mirror the details of the Java specifications in Groovy, but I still think that simply treating var the same as def looses some potential for the static compilation case, e.g.: var myVar = new

Re: About supporting `var` of Java10+

2018-03-07 Thread Daniel Sun
Thanks for your reviewing the RI. The following code is truely allowed in Groovy, fewer limitation than Java 10+. So we can think the current RI as a enhanced implementation for `var` ;-) ``` var myVar = new Foo() myVar = 123 ``` Cheers, Daniel.Sun -- Sent from:

Re: About supporting `var` of Java10+

2018-03-07 Thread Jesper Steen Møller
Hi list It’s not a keyword in Java 10, it’s just a reserved identifier. In other words, “int var = 10;” is still legal. I’m thinking we should remain as conservative as Java in those matters. -Jesper > On 8 Mar 2018, at 02.23, MG wrote: > > Hi Daniel, > > I agree that

Re: About supporting `var` of Java10+

2018-03-07 Thread Jesper Steen Møller
Yes, I see it now. I implemented 'var' for Eclipse's Java compiler, but did it without changing the grammar, so when I saw you'd changed the grammar, I wrongly assumed you hadn't thought of it. -Jesper

Re: About supporting `var` of Java10+

2018-03-07 Thread Daniel Sun
Hi Jochen, > Obviously we just have to set declaration type = current compile time type > to get something, which is very near to the planed var in Java. OK. I see :-) Cheers, Daniel.Sun -- Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html

Re: About supporting `var` of Java10+

2018-03-07 Thread Daniel Sun
Hi Jesper, Groovy already supports `int var = 10;` ;-) Cheers, Daniel.Sun -- Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html

Groovy 2.4.14 on JDK8 and JDK9

2018-03-07 Thread Russel Winder
Would I be right thinking that groovy.xml.DOMBuilder.parse(reader).documentElement.toString running using 2.4.14 behaves weirdly on JDK9 compared to JDK8? -- Russel. === Dr Russel Winder t: +44 20 7585 2200 41 Buckmaster Roadm: +44 7770 465 077

Re: Synthetic GroovyObject methods

2018-03-07 Thread Daniil Ovchinnikov
I’ve created https://issues.apache.org/jira/browse/GROOVY-8495 to track this. — Daniil Ovchinnikov Software Developer JetBrains jetbrains.com “Drive to develop” > On 6 Mar 2018, at 18:39, Daniil Ovchinnikov >