Safe index for Groovy 3

2016-11-08 Thread Daniel Sun
Hi all, The new parser supports safe index now, which is proposed by Paul King :) Here are some example code: assert null == null?[1]; assert null == null?[1]?[1, 2]; assert null == null?[1]?[1, 2]?[1, 2, 3]; def a = null; assert null == a?[1, 2]; def f() {return null} assert null

Re: Safe index for Groovy 3

2016-11-08 Thread Daniel Sun
groovy-all-2.5.0-SNAPSHOT jar file used by groovy-parser is a bit outdated, the following usual code can not be executed too(but it can be executed by 2.4.7...), so the static complication test cases will be added later :) @CompileStatic int cs() { List a = [1, 2, 3] return a[0]; } cs();

Re: Safe index for Groovy 3

2016-11-08 Thread Daniel Sun
Yeah, I like the idea too :) Cheers, Daniel.Sun -- View this message in context: http://groovy.329449.n5.nabble.com/Safe-index-for-Groovy-3-tp5736558p5736562.html Sent from the Groovy Dev mailing list archive at Nabble.com.

Re: Safe index for Groovy 3

2016-11-09 Thread Daniel Sun
Hi OC, IMHO, 'full safe' switch will change the semantic of existing '.', which may reduce the maintainability and readability of program, so the explicit '?' is necessary. Thanks for your suggestions :) Cheers, Daniel.Sun -- View this message in context: http://groovy.329449.n5.nabbl

About the parrot branch of apache/groovy

2016-11-11 Thread Daniel Sun
Hi all, In order to not impact the existing branches as possible as I can, I created a branch named "parrot" and put the new parser(Parrot) at the new branch, which is based on antlr4 branch and synchronized the changes from master. Currently there are 3 failed test cases waiting for PR(h

Re: About the parrot branch of apache/groovy

2016-11-11 Thread Daniel Sun
e? On Fri, Nov 11, 2016 at 4:48 PM, Daniel Sun <[hidden email]> wrote: Hi all, In order to not impact the existing branches as possible as I can, I created a branch named "parrot" and put the new parser(Parrot) at the new branch, which is based on antlr4 branch and syn

Re: About the parrot branch of apache/groovy

2016-11-12 Thread Daniel Sun
e on the parrot branch? Won't start up for me. I'm travelling without access to proper internet. I might have just grabbed a snapshot at an inopportune time. On 11 Nov 2016 8:35 PM, "Guillaume Laforge" <[hidden email]> wrote: Ok, makes sense! Le vendredi 11 novembre 2016,

Re: About the parrot branch of apache/groovy

2016-11-13 Thread Daniel Sun
Hi Paul, I used "gradlew -PuseAntlr4=true console" to launch groovyConsole. It's OK for me now. Can you reproduce the issue? In addition, the groovyConsole uses the old parser even if option "-PuseAntlr4=true" applied. I'll fix it later :) Cheers, Daniel.Sun -- View this message in

Negative relational operators for Groovy 3

2016-11-18 Thread Daniel Sun
Hi all, The new parser(Parrot) supports negative relational operators now, which is proposed by Guillaume Laforge :) Here are some example codes(https://github.com/danielsun1106/groovy-parser/blob/negativeRelationalOperators/src/test/resources/core/NegativeRelationalOperators_01x.groo

Re: groovy parsers as subprojecs

2016-11-18 Thread Daniel Sun
Hi Jochen, The "I)" variant looks better than other variants, which works fine now. BTW, glad to see you again in the mailing list :) Cheers, Daniel.Sun -- View this message in context: http://groovy.329449.n5.nabble.com/groovy-parsers-as-subprojecs-tp5736808p5736812.html Sent fro

Re: Negative relational operators for Groovy 3

2016-11-18 Thread Daniel Sun
Hi Jochen, > oh... and one question... is "! in" the same as "!in"? Yeah, the negative relational operators are combined operators, which will be transformed to normal NotExpression :) Cheers, Daniel.Sun -- View this message in context: http://groovy.329449.n5.nabble.com/Negative-relatio

Re: Negative relational operators for Groovy 3

2016-11-18 Thread Daniel Sun
Hi Jochen, > I think !instanceof and !in are ok. The others... not sure here. Right > now a*=b, which means !< is >=. And in this > case I actually prefer >=. Sometimes we write code like "!(a > b)", now we can write "a !> b" instead, which is much close to our mind :) Cheers, Daniel.

Re: Negative relational operators for Groovy 3

2016-11-18 Thread Daniel Sun
; wrote: On Fri, Nov 18, 2016 at 1:58 PM, Jochen Theodorou <[hidden email]> wrote: On 18.11.2016 13:45, Daniel Sun wrote: Hi all, The new parser(Parrot) supports negative relational operators now, which is proposed by Guillaume Laforge :) Here are some example codes(https://gi

Re: Negative relational operators for Groovy 3

2016-11-18 Thread Daniel Sun
OK. I see :) 在 Cédric Champeau [via Groovy] ,2016年11月18日 下午9:18写道: I agree with Jochen and Guillaume: +1 to !instanceof and !in, but I don't like the other variants. 2016-11-18 14:11 GMT+01:00 Daniel Sun <[hidden email]>: Hi Jochen, > I think !instanceof and !in are ok. The

Re: Negative relational operators for Groovy 3

2016-11-18 Thread Daniel Sun
Hi Guillaume, === and !=== are available for Groovy 3, so "!is" is not necessary. Currently only "!in" and "!instanceof" are supported with sticky style: https://github.com/danielsun1106/groovy-parser/commit/69023a63446d14add54f43d3d7797c9dd2a7f903 If it is ok, I'll merge it into par

Re: Negative relational operators for Groovy 3

2016-11-18 Thread Daniel Sun
Interesting, haha :) -- View this message in context: http://groovy.329449.n5.nabble.com/Negative-relational-operators-for-Groovy-3-tp5736809p5736831.html Sent from the Groovy Dev mailing list archive at Nabble.com.

Re: Negative relational operators for Groovy 3

2016-11-18 Thread Daniel Sun
> === and !=== are available for Groovy 3, so "!is" is not necessary. The identity operators should be === and !==:) Cheers, Daniel.Sun -- View this message in context: http://groovy.329449.n5.nabble.com/Negative-relational-operators-for-Groovy-3-tp5736809p5736834.html Sent from the

Re: Negative relational operators for Groovy 3

2016-11-18 Thread Daniel Sun
Hi Jochen, I've modified the implementation according to your suggestions that ONLY support !in and !instanceof with sticky style. In addition, !in and !instanceof are REAL operators now(https://github.com/danielsun1106/groovy-parser/commit/87e2c41763422a6642414028d84efdccb90bfcda) I'll

Re: Negative relational operators for Groovy 3

2016-11-18 Thread Daniel Sun
Hi Jochen, > "a !&& b" for a nand instead of "!(a && b)" or instead of "!a || !b" > then there is also ~& and !& Looks good. They've been added to my TODO list :) Cheers, Daniel.Sun -- View this message in context: http://groovy.329449.n5.nabble.com/Negative-relational-operators-for-Groovy

Re: Negative relational operators for Groovy 3

2016-11-19 Thread Daniel Sun
and probably 'is' too. If we do is, I don't see why we wouldn't do it for all methods (that return boolean), e.g. assert 'a'.!isUpperCase() and I am a little hesitant about such a notation. Paul. > On Fri, Nov 18, 2016 at 2:25 PM, Daniel Sun <[hidden email]> wro

Re: Negative relational operators for Groovy 3

2016-11-22 Thread Daniel Sun
Hi Jochen, According to your proposals, I'm going to add the following operators: 1) !&& a !&& b === !(a && b) 2) !||a !|| b === !(a || b) 3) !& a !& b === !(a & b) 4) !| a !| b === !(a | b) 5) ~& a ~& b === ~(a & b) 6) ~| a ~| b === ~(a | b)

[PROPOSAL]new operator ?=

2016-11-22 Thread Daniel Sun
Hi all, Marcin Erdmann proposed the new operator ?=, e.g. a ?= "foo" is equivalent of a = a ?: "foo". I like his idea, what do you think about it? Cheers, Daniel.Sun -- View this message in context: http://groovy.329449.n5.nabble.com/PROPOSAL-new-operator-tp5736886.html Sent from

回复: Re: [PROPOSAL]new operator ?=

2016-11-22 Thread Daniel Sun
1月23日 上午12:47 收件人: "Daniel Sun" 主题: Re: [PROPOSAL]new operator ?= On 22.11.2016 15:25, Guillaume Laforge wrote: > It's a feature that's often be requested. > I think Ruby's got an equivalent with ||=, and it's often the reference > people give whe

Re: [PROPOSAL]new operator ?=

2016-11-23 Thread Daniel Sun
Hi Jochen, > Maybe we should start a vote of ?= or not... maybe on the user list... > then we see what people think. Daniel might have been a bit too fast here I'd like to start the vote of ?=;) Just ask whether like it or not? Or like Andres's vote, ask which operator do you like:

Re: Negative relational operators for Groovy 3

2016-11-23 Thread Daniel Sun
ption: startup failed: ConsoleScript18: 9: Unexpected input: 'assert'; Expecting RPAREN @ line 9, column 1. assert 3 !in [] ^ 1 error I did build with -PuseAntlr4=true though. Guillaume On Fri, Nov 18, 2016 at 1:45 PM, Daniel Sun <[hidden email]> wrote: Hi all, The new

Re: Proposal - Pattern matching elixir way

2016-11-25 Thread Daniel Sun
Hi Jorge, First of all, thanks for your proposal. I wonder why do you want the feature? What senarios make the code such as "@When('!file || !new File(path).exists()')" overwhelm existing features of groovy(e.g. switch statement)? Cheers, Daniel.Sun -- View this message in context

Elvis Assignment for Groovy 3

2016-12-03 Thread Daniel Sun
Hi all, The new parser "Parrot" supports Elvis Assignment(i.e. ?=) now. Here are some examples: def a = 2 a ?= 1 assert a == 2 a = null a ?= 1 assert a == 1 a = null a ?= a ?= 1 assert a == 1 P.S. supports static compilation as well. Cheers, Daniel

Re: Elvis Assignment for Groovy 3

2016-12-03 Thread Daniel Sun
My pleasure ;) Cheers, Daniel.Sun 在 "Marcin Erdmann [via Groovy]" ,2016年12月3日 下午5:01写道: Awesome, thanks for implementing it Daniel. On Sat, Dec 3, 2016 at 7:59 AM, Daniel Sun <[hidden email]> wrote: Hi all, The new parser "Parrot" supports Elvis Assignme

Re: Elvis Assignment for Groovy 3

2016-12-03 Thread Daniel Sun
Thanks :) 在 "Guillaume Laforge [via Groovy]" ,2016年12月3日 下午7:55写道: Very cool! On Sat, Dec 3, 2016 at 10:01 AM, Marcin Erdmann <[hidden email]> wrote: Awesome, thanks for implementing it Daniel. On Sat, Dec 3, 2016 at 7:59 AM, Daniel Sun <[hidden email]> wrote: Hi all,

Default Method for Groovy 3

2016-12-08 Thread Daniel Sun
Hi all, The new parser(Parrot) supports default method now. You can find the new feature at the enhancedInterface branch of groovy-parser project ( https://github.com/danielsun1106/groovy-parser/commit/89f45ac86e794

Re: Default Method for Groovy 3

2016-12-08 Thread Daniel Sun
specifying a default method in the JVM spec, hence no ACC_DEFAULT flag in ASM, a default method is just a non abstract method in an interface. Also default and static methods in interface can be either public or private. cheers, Rémi - Mail original ----- > De: "Daniel Sun" &l

Re: Default Method for Groovy 3

2016-12-08 Thread Daniel Sun
JVM spec, hence no ACC_DEFAULT flag in ASM, a default method is just a non abstract method in an interface. Also default and static methods in interface can be either public or private. cheers, Rémi - Mail original ----- > De: "Daniel Sun" <[hidden email]> > À: [hidden e

Re: Default Method for Groovy 3

2016-12-08 Thread Daniel Sun
c 2016 at 17:40, Daniel Sun <[hidden email]> wrote: Hi all, The new parser(Parrot) supports default method now. You can find the new feature at the enhancedInterface branch of groovy-parser project <https://github.com/danielsun1106/groovy-parser/tree/enhancedInterface

Re: Default Method for Groovy 3

2016-12-08 Thread Daniel Sun
Thanks ;) 在 "Guillaume Laforge [via Groovy]" ,2016年12月9日 上午2:21写道: Awesome! On Thu, Dec 8, 2016 at 6:40 PM, Daniel Sun <[hidden email]> wrote: Hi all, The new parser(Parrot) supports default method now. You can find the new feature at the enhancedInterface branch

Re: Welcome to our new committer : Sergei Egorov

2016-12-10 Thread Daniel Sun
Hi Sergei, Congratulations! I believe Groovy will be much more powerful because of your endless effort :-) Cheers, Daniel.Sun -- View this message in context: http://groovy.329449.n5.nabble.com/Welcome-to-our-new-committer-Sergei-Egorov-tp5737173p5737178.html Sent from the Groovy Dev m

About SimpleHTTPServer

2016-12-11 Thread Daniel Sun
Hi all, Does Groovy provide any function like Python's SimpleHTTPServer(e.g. python -m SimpleHTTPServer 8000)? If no similar module exits, I'd like to implement one via Groovy 3(e.g. groovy -m SimpleHTTPServer 8000). FYI: https://docs.python.org/2/library/simplehttpserver.html Cheer

Re: About SimpleHTTPServer

2016-12-11 Thread Daniel Sun
Yeah, I think so too, but I'm not sure whether Groovy already has some similar function or not... Cheers, Daniel.Sun -- View this message in context: http://groovy.329449.n5.nabble.com/About-SimpleHTTPServer-tp5737191p5737196.html Sent from the Groovy Dev mailing list archive at Nabble.com.

Re: About SimpleHTTPServer

2016-12-11 Thread Daniel Sun
Hi Remi, Your reply is always so helpful :-) As far as I remember, Sun introduced the http server in Java6. It's lucky for us that it's included in the OpenJDK too. Cheers, Daniel.Sun -- View this message in context: http://groovy.329449.n5.nabble.com/About-SimpleHTTPServer-tp57

Re: About SimpleHTTPServer

2016-12-11 Thread Daniel Sun
Hi Jochen, Given we have a directory containing some web pages and want to access these pages via http protocal(e.g. we want to test WebRTC app), we have to run a httpserver to provide http service. In the past, we have to use Python to achieve the requirement because its SimpleHTTPServer i

Re: About SimpleHTTPServer

2016-12-11 Thread Daniel Sun
Hi Sébastien, The SimpleHTTPServer will be implemented with NO 3rd part library, so it will not impact existing production systems. In addition, it is recommended to be used to provide http service for convenience(such as testing WebRTC app). If we want to deploy our static web site, the Simp

Re: About SimpleHTTPServer

2016-12-11 Thread Daniel Sun
Hi Paul, The built-in httpserver of JDK suggested by Remi seems better for us, it is stable and does not require 3rd party library: http://hg.openjdk.java.net/jdk9/jdk9/jdk/file/tip/src/jdk.httpserver/share/classes/com/sun/net/httpserver/package-info.java As to hooking to the ex

Re: About SimpleHTTPServer

2016-12-11 Thread Daniel Sun
Thanks for your suggestion, mrhaki :) In order to avoid maintaining the httpserver, I'd like to use the built-in httpserver of JDK. Cheers, Daniel.Sun -- View this message in context: http://groovy.329449.n5.nabble.com/About-SimpleHTTPServer-tp5737191p5737213.html Sent from the Groovy Dev mail

Re: About SimpleHTTPServer

2016-12-11 Thread Daniel Sun
Hi Cédric, It is also available in the openjdk, any potential problem with it? http://hg.openjdk.java.net/jdk9/jdk9/jdk/file/tip/src/jdk.httpserver/share/classes/com/sun/net/httpserver/package-info.java Cheers, Daniel.Sun -- View this message in context: http://groovy.329449.n5.nabble.

Re: About SimpleHTTPServer

2016-12-11 Thread Daniel Sun
That's great :) -- View this message in context: http://groovy.329449.n5.nabble.com/About-SimpleHTTPServer-tp5737191p5737216.html Sent from the Groovy Dev mailing list archive at Nabble.com.

Re: About SimpleHTTPServer

2016-12-12 Thread Daniel Sun
Hi Sébastien, > My concern is that an HTTP server built into groovy would come with its > potential risks – even it is not used directly. To be frank, I can not figure out... Could you tell me some exact potential risks? > Having to redeploy an > app where groovy is embedded because of

SimpleHTTPServer for Groovy 3( Maybe Groovy 2.5.0? )

2016-12-14 Thread Daniel Sun
Hi all, SimpleHTTPServer has been implemented(http://bit.ly/2hsKm0V), it supports serving files not only under directory but also in the zip file. Here is the usage: "-lh listen on a port and provide http service", e.g. *serve files under current directory*: groovy -lh 8000 *serve

Re: groovy git commit: Add option -lh to launch SimpleHTTPServer

2016-12-14 Thread Daniel Sun
Hi Paul, I agree with you, but in my fork(danielsun1106/groovy) contains many exprimental commits and some failing build commits... I'm afraid these commits will "pollute" apache/groovy if I create PR and the PR merged. Any advice? Cheers, Daniel.Sun -- View this message in context: htt

Re: SimpleHTTPServer for Groovy 3( Maybe Groovy 2.5.0? )

2016-12-14 Thread Daniel Sun
> groovy -m com.sparkjava:spark-groovy -c "serve(port: 8080, path: 'd:\\temp')" How many characters will we type... to be frank, I am not that patient to type such a long command. Cheers, Daniel.Sun -- View this message in context: http://groovy.329449.n5.nabble.com/SimpleHTTPServer-for-Groovy

Re: SimpleHTTPServer for Groovy 3( Maybe Groovy 2.5.0? )

2016-12-14 Thread Daniel Sun
stuff into the groovy itself, but, i.e. in a case of python, SimpleHTTPServer it's just a module after all. I would rather see something like: groovy -m com.sparkjava:spark-groovy -c "serve(port: 8080, path: 'd:\\temp')" On Wed, Dec 14, 2016 at 2:29

Re: SimpleHTTPServer for Groovy 3( Maybe Groovy 2.5.0? )

2016-12-14 Thread Daniel Sun
t;serve(port: 8080, path: 'd:\\temp')" On Wed, Dec 14, 2016 at 2:29 PM Daniel Sun <[hidden email]> wrote: Hi all, SimpleHTTPServer has been implemented(http://bit.ly/2hsKm0V), it supports serving files not only under directory but also in the zip file. H

Re: groovy git commit: Add option -lh to launch SimpleHTTPServer

2016-12-15 Thread Daniel Sun
OK. I will revert them later. Cheers, Daniel.Sun 在 "Graeme Rocher-2 [via Groovy]" ,2016年12月15日 15:49写道: Agreed. "parrot" should be kept about the gramma and not adding new features. Cheers On Wed, Dec 14, 2016 at 1:49 PM, Daniel Sun <[hidden email]> wrote: &

Re: Gramma around annotations

2016-12-15 Thread Daniel Sun
Hi Graeme, It should be feasible in theory. Cheers, Daniel.Sun -- View this message in context: http://groovy.329449.n5.nabble.com/Gramma-around-annotations-tp5737249p5737255.html Sent from the Groovy Dev mailing list archive at Nabble.com.

About actor syntax for Groovy 3

2017-01-07 Thread Daniel Sun
Hi all, As we all know, GPars is awesome in concurrency programming. How about introducing a new syntax for GPars's actor(http://www.gpars.org/guide/guide/actors.html) to support concurrency programming better like Erlang and Scala(https://rocketeer.be/articles/concurrency-in-erlang-scala/)?

Re: About actor syntax for Groovy 3

2017-01-07 Thread Daniel Sun
class ActorTest { def counter = new Counter() counter.start() for (i in 0 .. 10) { counter <- i// send message to the counter actor } } should be modified as: class ActorTest { public static void main(String[] args) { def counter = new Counter()

Re: About actor syntax for Groovy 3

2017-01-07 Thread Daniel Sun
pale shade of Scala. Custom syntax and new operators are pushing Groovy in that direction. Cheers Andres Sent from my primitive Tricorder > On Jan 7, 2017, at 6:21 PM, Daniel Sun <[hidden email]> wrote: > > class ActorTest { >def counter = new Counter() >cou

Re: About actor syntax for Groovy 3

2017-01-07 Thread Daniel Sun
Yeah, << is a better choice ;) 在 Jesper Steen Møller [via Groovy] ,2017年1月8日 上午1:31写道: But Wouldn’t << be a natural choice which would work today? -Jesper > On 7 Jan 2017, at 18.16, Daniel Sun <[hidden email]> wrote: > > Hi all, > > As we all know

Re: About actor syntax for Groovy 3

2017-01-07 Thread Daniel Sun
direction. Cheers Andres Sent from my primitive Tricorder > On Jan 7, 2017, at 6:21 PM, Daniel Sun <[hidden email]> wrote: > > class ActorTest { >def counter = new Counter() >counter.start() > >for (i in 0 .. 10) { >counter <- i//

Re: About actor syntax for Groovy 3

2017-01-08 Thread Daniel Sun
Hi Jochen, I'm looking for a new syntax for concurrency programming, which should be able to hide complex for developers. As you said, the actor syntax is not necessary. I agree with you, because it just replaces 'send' method with '<<', but I wish the topic could let us think about the con

Re: next releases

2017-01-17 Thread Daniel Sun
Hi Paul, Will the new parser Parrot be included in 2.5.x releases as an optional parser? If developers want to give it a try, just turn on the switch "-Dgroovy.antlr4=true". Cheers, Daniel.Sun -- View this message in context: http://groovy.329449.n5.nabble.com/next-releases-tp5737758p57

Re: next releases

2017-01-17 Thread Daniel Sun
Hi Andres, > I'd suggest to release 2.5.0-beta and 3.0-ea together. Just like the JDK > team has been posting JDK9 EA releases, we could do the same. We know for > a fact we're going to break things, so let's make sure the public has > ample time to test out the changes. I like your idea :)

答复: next releases

2017-01-17 Thread Daniel Sun
. Grails, Gradle, Spock, Geb. But we are not sure Parrot can cover all *wild* syntax... Cheers, Daniel.Sun 发件人: Thibault Kruse [via Groovy]<mailto:ml-node+s329449n5737781...@n5.nabble.com> 发送时间: 2017年1月18日 6:46 收件人: Daniel Sun<mailto:realblue...@hotmail.com> 主题: Re: next releases A

答复: next releases

2017-01-17 Thread Daniel Sun
Hi Paul, OK. I understand others’s fears ?? Maybe releasing 3.0.0-ea and 2.5.0-beta together suggested by Andres is feasible. Cheers, Daniel.Sun 发件人: paulk_asert [via Groovy]<mailto:ml-node+s329449n5737780...@n5.nabble.com> 发送时间: 2017年1月18日 6:42 收件人: Daniel Sun<mailto

The order of modifiers and annotations

2017-01-18 Thread Daniel Sun
Hi all, Currently the old parser allows mixing modifiers and annotations, e.g. *Current* @interface Test1 {} @interface Test2 {} @Test1 final @Test2 a *Suggested* @interface Test1 {} @interface Test2 {} @Test1 @Test2 final a In addition, the order of modifiers is arbitrary too,

Re: The order of modifiers and annotations

2017-01-18 Thread Daniel Sun
Should we check the redundant modifiers? e.g. *Current* class A { private def a // def is redundant. IMHO, I really don't like it... } *Suggested* class A { private a } Cheers, Daniel.Sun -- View this message in context: http://groovy.329449.n5.nabble.com/The-order-of-modifiers-and

Re: The order of modifiers and annotations

2017-01-19 Thread Daniel Sun
> def is by now to be thought of as an alias for Object OK. I see. Thanks :) Cheers, Daniel.Sun -- View this message in context: http://groovy.329449.n5.nabble.com/The-order-of-modifiers-and-annotations-tp5737808p5737813.html Sent from the Groovy Dev mailing list archive at Nabble.com.

Re: The order of modifiers and annotations

2017-01-19 Thread Daniel Sun
I'll take a look at the issue later. Cheers, Daniel.Sun -- View this message in context: http://groovy.329449.n5.nabble.com/The-order-of-modifiers-and-annotations-tp5737808p5737818.html Sent from the Groovy Dev mailing list archive at Nabble.com.

Re: The order of modifiers and annotations

2017-01-19 Thread Daniel Sun
I verified that the new parser Parrot does not have the issue( GROOVY-4757 ), the following test case was added in the parrot branch. And I'll resolve the JIRA issue later. https://github.com/apache/groovy/commit/348465a1b193703c43aafeaabf2b2866

Re: The order of modifiers and annotations

2017-01-19 Thread Daniel Sun
You're welcome :) -- View this message in context: http://groovy.329449.n5.nabble.com/The-order-of-modifiers-and-annotations-tp5737808p5737826.html Sent from the Groovy Dev mailing list archive at Nabble.com.

The priority of .. and . (GROOVY-3240)

2017-01-19 Thread Daniel Sun
Hi all, I'm taking a look at GROOVY-3240 , which was raised by me some years ago. I wonder whether .. has higher priority than DOT(.) or not. Cheers, Daniel.Sun -- View this message in context: http://groovy.329449.n5.nabble.com/The-

Re: The priority of .. and . (GROOVY-3240)

2017-01-19 Thread Daniel Sun
.foo()..4.foo() == 4..5 ​ ​ On Thu, Jan 19, 2017 at 1:25 PM, Daniel Sun <[hidden email]> wrote: Hi all, I'm taking a look at GROOVY-3240 <https://issues.apache.org/jira/browse/GROOVY-3240> , which was raised by me some years ago. I wonder whether .. has higher priori

Re: The order of modifiers and annotations

2017-01-20 Thread Daniel Sun
Thanks :) 在 "Marcin Erdmann [via Groovy]" ,2017年1月20日 下午5:09写道: Awesome! On Thu, Jan 19, 2017 at 11:01 AM, Daniel Sun <[hidden email]> wrote: I verified that the new parser Parrot does not have the issue( GROOVY-4757 <https://issues.apache.org/jira/browse/GROOVY-4757>

About array initializer of Java style for Groovy 3

2017-01-23 Thread Daniel Sun
Hi all, Java supports specifing initial values while creating arrays, e.g. `new int[] {1, 2, 3}`, `new String[] { hello(), world() }`, etc. I plan to add this syntax for Groovy 3 to improve the compatibility between Groovy and Java. Any thoughts? Cheers, Daniel.Sun -- View this

Re: About array initializer of Java style for Groovy 3

2017-01-24 Thread Daniel Sun
Hi Andres, Parrot can parse ` def a = {1, 2, 3}` properly, but it can not parse `{1, 2, 3}`, which is not supported by Java too. This is the initial implementation :) https://github.com/danielsun1106/groovy-parser/commit/96e6c923a4d09d48448f8731a314c918ee6c0e7c Cheers, Daniel.Sun

Re: About array initializer of Java style for Groovy 3

2017-01-24 Thread Daniel Sun
closure 在 "Guillaume Laforge [via Groovy]" ,2017年1月24日 16:54写道: What happens for def a = { 2 }, is it parsed as a closure or an array initializer? On Tue, Jan 24, 2017 at 9:52 AM, Daniel Sun <[hidden email]> wrote: Hi Andres, Parrot can parse ` def a = {1, 2, 3}`

Re: About array initializer of Java style for Groovy 3

2017-01-24 Thread Daniel Sun
or we just support new int[] {1,2,3} ? 在 "Guillaume Laforge [via Groovy]" ,2017年1月24日 16:54写道: What happens for def a = { 2 }, is it parsed as a closure or an array initializer? On Tue, Jan 24, 2017 at 9:52 AM, Daniel Sun <[hidden email]> wrote: Hi Andres, Parrot c

Re: About array initializer of Java style for Groovy 3

2017-01-24 Thread Daniel Sun
y explicit array initilization with array type, that is "new int[] { 2 }" for compatibility's sake. Sent from my iPhone On 24 Jan 2017, at 09:59, Daniel Sun <[hidden email]> wrote: or we just support new int[] {1,2,3} ? 在 "Guillaume Laforge [via Groovy]" ,2017年1月24日

Re: About array initializer of Java style for Groovy 3

2017-01-24 Thread Daniel Sun
Hi Rémi, The improvement has been completed in my groovy-parser repository, it is being tested now. I'll sync them to parrot branch of apache/groovy later :) Thanks for your clear explanation and advice! Cheers, Daniel.Sun -- View this message in context: http://groovy.329449.n5.

Array initializer of Java style for Groovy 3

2017-01-24 Thread Daniel Sun
Hi all, The new parser Parrot support array initializer of Java style, e.g. new int[] {1, 2, 3}, new int[][]{new int[]{1, 1.plus(1)}, new int[] {2.plus(1), 4}}, new String[] {'hello', 'world'} More examples can be found at https://github.com/danielsun1106/groovy-parser/blob/master/src

答复: Array initializer of Java style for Groovy 3

2017-01-24 Thread Daniel Sun
Thanks ?? 发件人: Cédric Champeau [via Groovy]<mailto:ml-node+s329449n5737956...@n5.nabble.com> 发送时间: 2017年1月24日 20:18 收件人: Daniel Sun<mailto:realblue...@hotmail.com> 主题: Re: Array initializer of Java style for Groovy 3 Great work! 2017-01-24 13:12 GMT+01:00 Daniel Sun <[hidden

Re: Parrot and the ++ and -- operators

2017-01-24 Thread Daniel Sun
Hi Joe, I've added your sample code as test cases(https://github.com/danielsun1106/groovy-parser/commit/9914682e53fb2fe3d4bb335c8153e61066cea317). Parrot has same result with the old parser ;) Cheers, Daniel.Sun -- View this message in context: http://groovy.329449.n5.nabble.com/Parrot-

Re: Traits and protected properties

2017-01-25 Thread Daniel Sun
Hi Cédric, > having a protected property just cannot work Could you tell me why trait does not support protected property? Thanks, Daniel.Sun -- View this message in context: http://groovy.329449.n5.nabble.com/Traits-and-protected-properties-tp5738002p5738019.html Sent from the Groovy Dev m

Re: release process

2017-01-25 Thread Daniel Sun
Hi Jesper, > I recognise that the Antlr4 parser AST building looks really neat in Java > 8, but easthetics aside That's why I choose Java 8 to rewrite the parser :) Cheers, Daniel.Sun -- View this message in context: http://groovy.329449.n5.nabble.com/release-process-tp5737841p5738020.html Se

Re: Traits and protected properties

2017-01-25 Thread Daniel Sun
OK. I see. Thanks :) BTW, the interface with default methods is based on Traits, I found Traits does not support static methods too... So maybe we should generate bytecode for default methods and static methods of interface as Java 8 do. Cheers, Daniel.Sun -- View this message in context: htt

Re: Traits and protected properties

2017-01-25 Thread Daniel Sun
Hi Graeme, Here is my test code, which fails: trait A { public static String m() { return '123' } } A.m() error messages: groovy.lang.MissingMethodException: No signature of method: static A.m() is applicable for argument types: () values: [] Possible solutions: is(java.lang.Object),

Re: Traits and protected properties

2017-01-25 Thread Daniel Sun
Hi Cédric, > oh and that's written in the docs Groovy's documentation is so detail... it's hard for me to believe ;) BTW, Java 8 supports static methods and default methods in the interfaces, how about refining the implementation of traits based on the enhanced interfaces? then traits can have i

Re: Traits and protected properties

2017-01-25 Thread Daniel Sun
Hi Cédric, As far as I remember, Groovy 3+ will require Java 8. So maybe we could upgrade the default version of class file to Java 8+ in Groovy 3+ releases? Cheers, Daniel.Sun -- View this message in context: http://groovy.329449.n5.nabble.com/Traits-and-protected-properties-tp5738002p5

About the "implies" operator(GROOVY-2576)

2017-01-25 Thread Daniel Sun
Hi all, The "implies" operator "=>" was suggested many years ago, here is the replated JIRA issue( GROOVY-2576 ) . Do you want it for Groovy 3? (+1: yes; -1: no; 0: not bad) BTW, recently I have been going through the issues

Re: About the "implies" operator(GROOVY-2576)

2017-01-25 Thread Daniel Sun
Hi Jochen, Thanks for your analysis in detail :) => is a very expressive operator. if we could implement it as +(corresponding to plus method) does and apply different business logic when necessary, it would be much more useful. And the default implementation of "implies" method c

One more new operator "implies" ( => ) for Groovy 3

2017-01-26 Thread Daniel Sun
Hi all, The new parser Parrot supports "implies" operator( => ) now, e.g. if (itIsRaining => iAmUsingUmbrella) { println 'I am dry' } More examples can be found at: 1) https://github.com/danielsun1106/groovy-parser/blob/impliesOperator/src/test/resources/core/ImpliesOp_01x.groovy

答复: About the "implies" operator(GROOVY-2576)

2017-01-26 Thread Daniel Sun
Hi Cédric, Here is the background of the “implies” operator, which is well known in the mathematical logic ?? http://mathworld.wolfram.com/Implies.html 发件人: Cédric Champeau [via Groovy]<mailto:ml-node+s329449n5738104...@n5.nabble.com> 发送时间: 2017年1月26日 17:12 收件人: Dani

答复: 答复: About the "implies" operator(GROOVY-2576)

2017-01-26 Thread Daniel Sun
Hi Guillaume, When we deal with logic, abstraction is very important to simplify reasoning. The “implies” operator can give us a hand here 😊 Cheers, Daniel.Sun 发件人: Guillaume Laforge [via Groovy]<mailto:ml-node+s329449n5738107...@n5.nabble.com> 发送时间: 2017年1月26日 17:34 收件人: Dani

答复: One more new operator "implies" ( => ) for Groovy 3

2017-01-26 Thread Daniel Sun
Hi Jochen, => has lower priority than &&, ||, &, | Cheers, Daniel.Sun 发件人: Jochen Theodorou [via Groovy]<mailto:ml-node+s329449n5738113...@n5.nabble.com> 发送时间: 2017年1月26日 18:42 收件人: Daniel Sun<mailto:realblue...@hotmail.com> 主题: Re: One more new operator &q

答复: 答复: About the "implies" operator(GROOVY-2576)

2017-01-26 Thread Daniel Sun
Hi Jochen, Some like it, some don’t. Understanding the new operator needs some knowledge of mathematical logic. Cheers, Daniel.Sun 发件人: Jochen Theodorou [via Groovy]<mailto:ml-node+s329449n5738114...@n5.nabble.com> 发送时间: 2017年1月26日 18:44 收件人: Daniel Sun<mailto:realblue...@hotmai

答复: 答复: About the "implies" operator(GROOVY-2576)

2017-01-26 Thread Daniel Sun
017年1月26日 19:07 收件人: Daniel Sun<mailto:realblue...@hotmail.com> 主题: Re: 答复: About the "implies" operator(GROOVY-2576) On 26.01.2017 11:13, Andres Almiray wrote: > Here's another idea: > > What if this new operator and other syntax changes were to be introduced >

答复: About the "implies" operator(GROOVY-2576)

2017-01-26 Thread Daniel Sun
approach can deal with it. Thanks for your suggestion 😊 Cheers, Daniel.Sun 发件人: Jesper Steen Møller [via Groovy]<mailto:ml-node+s329449n5738122...@n5.nabble.com> 发送时间: 2017年1月26日 19:24 收件人: Daniel Sun<mailto:realblue...@hotmail.com> 主题: Re: About the "implies" operator(G

Re: 答复: One more new operator "implies" ( => ) for Groovy 3

2017-01-27 Thread Daniel Sun
Since 30% of 76 developers don't like the new operator, it will be postponed to merge into Apache Groovy util most of us like it. Cheers, Daniel.Sun -- View this message in context: http://groovy.329449.n5.nabble.com/One-more-new-operator-implies-for-Groovy-3-tp5738103p5738162.html Sent from

Standard "for" loop statement for Groovy 3

2017-01-28 Thread Daniel Sun
Hi all, The new parser Parrot supports standard "for" loop statement(conforming to JLS) now, e.g. 1) for (int i = 0, n = 10; i < n; i++) {..} 2) for(int i = 0, j = 10; i < j; i++, j--) {..} More examples: 1) https://github.com/danielsun1106/groovy-parser/blob/master/src/test/resource

Re: Standard "for" loop statement for Groovy 3

2017-01-28 Thread Daniel Sun
BTW, the old parser just supports limited "for" loop statement, e.g. for (int i = 0; i < 10; i++) {..} Cheers, Daniel.Sun -- View this message in context: http://groovy.329449.n5.nabble.com/Standard-for-loop-statement-for-Groovy-3-tp5738199p5738200.html Sent from the Groovy Dev mailing list ar

About the performance of the test builds

2017-01-29 Thread Daniel Sun
Hi all, I noticed that test builds that use JDK 8 cost different time, they run tests from master and parrot branch(contains all commits from master)(http://ci.groovy-lang.org/project.html?projectId=Groovy), e.g. BUILDTESTS COUNTCOSTED TIME

答复: About the performance of the test builds

2017-01-29 Thread Daniel Sun
23m:48s Cheers, Daniel.Sun 发件人: Jochen Theodorou [via Groovy]<mailto:ml-node+s329449n5738219...@n5.nabble.com> 发送时间: 2017年1月30日 0:58 收件人: Daniel Sun<mailto:realblue...@hotmail.com> 主题: Re: About the performance of the test builds On 29.01.2017 15:46, Daniel Sun wrot

  1   2   3   4   5   >