groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Russel Winder <rus...@winder.org.uk>
Subject Re: About actor syntax for Groovy 3
Date Sat, 07 Jan 2017 19:45:45 GMT
GPars is a library, it can have no special syntax other than what
Groovy provides.

Given Groovy has no <- operator and no way of creating library defined
operators it seems impossible to have this operator.  Even though is it
a very Go way of doing message passing.

On Sat, 2017-01-07 at 18:34 +0100, jim northrop wrote:
> Russel is working on GPars v2.0 so have asked him if this proposed
> change
> is do-able.
> 
> On 7 January 2017 at 18:28, Andres Almiray <aalmiray@gmail.com>
> wrote:
> 
> > 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.
-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder@ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel@winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
Mime
View raw message