groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andres Almiray <aalmi...@gmail.com>
Subject Re: About actor syntax for Groovy 3
Date Sat, 07 Jan 2017 17:28:38 GMT
This is a slippery slope IMHO. 

Adding custom syntax support in core for GPars might sound like a good idea given the fact
that GPars is bundled with core. OTOH what about Spock, Grails, Ratpack and others? Wouldn't
they benefit from custom syntax too? probably yes. Are they bundled with core? no, and they
shouldn't. 

My recommendation would be to prototype an AST transformation that can support the syntax,
just like Spock does it. 

One more thing, I would be very sad to see Groovy become a 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 <realbluesun@hotmail.com> wrote:
> 
> class ActorTest  {
>    def counter = new Counter()
>    counter.start()
> 
>    for (i in 0 .. 100000) {
>        counter <- i    // send message to the counter actor
>    }
> } 
> 
> should be modified as:
> 
> class ActorTest  {
>    public static void main(String[] args) {
>        def counter = new Counter()
>        counter.start()
> 
>        for (i in 0 .. 100000) {
>          counter <- i    // send message to the counter actor
>        }
>    }
> } 
> 
> 
> 
> --
> View this message in context: http://groovy.329449.n5.nabble.com/About-actor-syntax-for-Groovy-3-tp5737574p5737575.html
> Sent from the Groovy Dev mailing list archive at Nabble.com.

Mime
View raw message