Proposal: allow @DelegatesTo on Map arguments

2016-10-04 Thread Graeme Rocher
Hi all, I would like to propose adding support for @DelegatesTo on named arguments (Map types) in order to improve static compilation support for builders. I have written up https://issues.apache.org/jira/browse/GROOVY-7956 For the proposal. Here are some considerations: * Keys have to be Stri

Re: Proposal: allow @DelegatesTo on Map arguments

2016-10-04 Thread Andrew Bayer
I was just wishing for this a couple weeks ago! I'd love to see this added. A. On Oct 4, 2016 2:57 PM, "Graeme Rocher" wrote: > Hi all, > > I would like to propose adding support for @DelegatesTo on named > arguments (Map types) in order to improve static compilation support > for builders. I h

RE: [PROGRESS REPORT 20161004]groovy-parser

2016-10-04 Thread Miles, Chris (MFT)
Excellent, well done! From: daniel_sun [realblue...@hotmail.com] Sent: 03 October 2016 17:22 To: d...@groovy.incubator.apache.org Subject: [PROGRESS REPORT 20161004]groovy-parser Hi List, Currently the new parser can parse almost all groovy source

Proposal: Statically compileable builders

2016-10-04 Thread Graeme Rocher
Closely linked to https://issues.apache.org/jira/browse/GROOVY-7956 I would like to propose adding the ability to create builders that can be statically compiled by adding a capability similar to Scala's Dynamic: https://issues.apache.org/jira/browse/GROOVY-7957 Some considerations: * Behavior

Re: Proposal: Statically compileable builders

2016-10-04 Thread Sergei Egorov
Hi Graeme, FYI a few years ago I created an AST transformation for MapArguments: https://github.com/bsideup/GroovyMapArguments/blob/master/src/test/groovy/ru/trylogic/groovy/mapargs/MapArgumentsTest.groovy Might be helpful :) BR, Sergei On Tue, Oct 4, 2016 at 5:33 PM Graeme Rocher wrote: > C

Re: Proposal: Statically compileable builders

2016-10-04 Thread Graeme Rocher
Interesting. Also related to this, I wrote a type checking extension that makes it possible to statically compile StreamingJsonBuilder by delegating missing methods to invokeMethod: https://github.com/grails/grails-views/blob/master/core/src/main/groovy/grails/views/compiler/BuilderTypeCheckingExt

Re: Proposal: allow @DelegatesTo on Map arguments

2016-10-04 Thread Jochen Theodorou
sounds good On 04.10.2016 14:56, Graeme Rocher wrote: Hi all, I would like to propose adding support for @DelegatesTo on named arguments (Map types) in order to improve static compilation support for builders. I have written up https://issues.apache.org/jira/browse/GROOVY-7956 For the proposa

Re: Proposal: Statically compileable builders

2016-10-04 Thread Jochen Theodorou
On 04.10.2016 16:32, Graeme Rocher wrote: [...] I would like to propose adding the ability to create builders that can be statically compiled by adding a capability similar to Scala's Dynamic: https://issues.apache.org/jira/browse/GROOVY-7957 the question is what you really gain from that...

Re: Proposal: Statically compileable builders

2016-10-04 Thread Graeme Rocher
The use case is really around builders, not so much around regular objects. Builders don't really use return types that much, but if you did want return type information we could support methodMissing that return a concrete type. Typical builder code that could be statically compiled def json = n

RE: [PROGRESS REPORT 20161004]groovy-parser

2016-10-04 Thread atuzov .
+1 4 окт. 2016 г. 16:34 пользователь "Miles, Chris (MFT)" написал: > Excellent, well done! > > From: daniel_sun [realblue...@hotmail.com] > Sent: 03 October 2016 17:22 > To: d...@groovy.incubator.apache.org > Subject: [PRO

Re: Proposal: allow @DelegatesTo on Map arguments

2016-10-04 Thread Shil Sinha
+1 I was writing a type checking extension that did this but it would much better if it were built into the compiler itself On Tue, Oct 4, 2016 at 11:18 AM, Jochen Theodorou wrote: > sounds good > > > On 04.10.2016 14:56, Graeme Rocher wrote: > >> Hi all, >> >> I would like to propose adding sup

Re: Proposal: Statically compileable builders

2016-10-04 Thread Jochen Theodorou
On 04.10.2016 18:00, Graeme Rocher wrote: [...] If you combine this will my other proposal around allowing delegates to on maps you can see that you could implement markup builder for static compilation mkp.html { body { div id:"test" } } ok, let us assume mkp is a @

Re: [PROGRESS REPORT 20161004]groovy-parser

2016-10-04 Thread daniel_sun
I'm trying to set the new parser as the default to build and test, *13396 tests completed, 6 failed, 9 skipped* https://travis-ci.org/danielsun1106/groovy -- View this message in context: http://groovy.329449.n5.nabble.com/PROGRESS-REPORT-20161004-groovy-parser-tp5735725p5735777.html

RE: [PROGRESS REPORT 20161004]groovy-parser

2016-10-04 Thread daniel_sun
Thanks :) -- View this message in context: http://groovy.329449.n5.nabble.com/PROGRESS-REPORT-20161004-groovy-parser-tp5735725p5735778.html Sent from the Groovy Dev mailing list archive at Nabble.com.

Re: Proposal: Statically compileable builders

2016-10-04 Thread Graeme Rocher
Hi Jochen, Thanks for the interesting analysis of dynamic dispatch via builders in dynamic Groovy! I feel though the conversation is getting slightly derailed, this is not about dynamic Groovy this about statically compiled Groovy. Let us revisit the goals: 1) Allow builders to be used when the c