Yeah, << is a better choice ;)
在 Jesper Steen Møller [via Groovy] <ml-node+s329449n5737577...@n5.nabble.com>,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, 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/)? We can > use <- to indicate sending messages(Erlang and Scala uses !). The initial > idea is shown as follows: > > // groovy.actor.Actor extends groovyx.gpars.actor.DefaultActor > class Counter extends groovy.actor.Actor { > int counter = 0; > > void act() { > react { int num -> > ... > } > } > } > > class ActorTest { > def counter = new Counter() > counter.start() > > for (i in 0 .. 100000) { > counter <- i // send message to the counter actor > } > } > > Any thoughts? > > Cheers, > Daniel.Sun > > > > -- > View this message in context: > http://groovy.329449.n5.nabble.com/About-actor-syntax-for-Groovy-3-tp5737574.html > Sent from the Groovy Dev mailing list archive at Nabble.com. ________________________________ If you reply to this email, your message will be added to the discussion below: http://groovy.329449.n5.nabble.com/About-actor-syntax-for-Groovy-3-tp5737574p5737577.html To unsubscribe from About actor syntax for Groovy 3, click here<http://groovy.329449.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5737574&code=cmVhbGJsdWVzdW5AaG90bWFpbC5jb218NTczNzU3NHwxMTQ2MjE4MjI1>. NAML<http://groovy.329449.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> -- View this message in context: http://groovy.329449.n5.nabble.com/About-actor-syntax-for-Groovy-3-tp5737574p5737582.html Sent from the Groovy Dev mailing list archive at Nabble.com.