bug fix releases ...

2020-02-25 Thread Paul King
We weren't planning another 2.4 release but there is a significant bug in
2_4_X which impacts Spock users using special characters in their method
names, 2_5_X users are calling for partial JDK 14 support, and we already
have some fixes in the 3_0_X stream that would be good to get out soon. So
I thought I would kick off some more point releases later this week or
early next week. Not promising all three at this stage but I'll see how I
go.

Time to get in any fixes that you'd like to be in the release or feedback
if you need me to hold off a little longer on any of those!

We should also get out an alpha of Groovy 4 but I don't think we will be
progressed enough for perhaps a month or two. :-)

Cheers, Paul.


Re: Execute a code segment during script compile

2020-02-25 Thread Saravanan Palanichamy
:D yes which is why I am using the script to gather intent and not using it as 
the runtime. I need to understand the retry parameters of 10 and 20. I gather 
this knowledge at the time of creation and compilation which is harmless to 
exits

On 2020/02/24 08:15:38, Alessio Stalla  wrote: 
> You wouldn't want to run @Retry({System.exit(0)}) on your server, I presume.
> 
> On Mon, 24 Feb 2020 at 00:39, Saravanan Palanichamy 
> wrote:
> 
> >
> >
> > On 2020/02/23 23:14:32, Paul King  wrote:
> > > Just for future reference, I'd probably start out with such a question on
> > > the users mailing list. There are more folks subscribed to that list and
> > > writing closures and transforms (using Groovy) are topics which that list
> > > covers. If it turned out that Groovy couldn't handle your use case, the
> > dev
> > > list (developing the language) would be the place to go to ask whether a
> > > feature could be added to the language.
> > >
> > > Having said that, to answer your question, there are quite a lot of
> > > things that are possible. Perhaps you could give a concrete simple
> > example
> > > of the kind of thing you are trying to do. I understand most of what you
> > > are saying but a few bits are still a little unclear (to me at least).
> > >
> > > Cheers, Paul.
> > >
> > >
> > > On Mon, Feb 24, 2020 at 9:06 AM Saravanan Palanichamy <
> > chava...@gmail.com>
> > > wrote:
> > >
> > > > Hello
> > > >
> > > > Is it possible to do this in the groovy AST transformation ->
> > > >
> > > > a) in a code visitor, visit a closure expression (in the
> > > > INSTRUCTION_SELECTION phase)
> > > > b) Using the Closure Node, execute this code to determine its results
> > > > based on different parameters
> > > >
> > > > Essentially I want to be able to selectively run a closure defined in
> > code
> > > > during the compile process. I see you can convert closures into
> > strings, is
> > > > it possible to compile that string in the middle of a compile process?
> > > >
> > > > I am not sure this is the right forum for this question, please let me
> > > > know if otherwise
> > > >
> > >
> >
> > Hello Paul
> >
> > Thank you for your reply. I am trying to do this specific thing
> > a) I allow my developers to write Groovy scripts
> > b) I use the script as a DSL to generate actual configuration files needed
> > for my service at runtime.
> > c) Because I need to translate the code to configuration entries, I need
> > to execute some parts of the script to determine config values. For example
> >
> > @Retry({new RetryParams(10, 20)})
> > void runSomeCodeInMyServer() {
> > }
> >
> > In the code above, lets say this code runs on my server, but the server
> > needs to be told that the parameters for the thread that executes this is
> > to retry it 10 times, with a 20 second interval.
> >
> > When parsing the groovy script, I need to pull out these 10 and 20 numbers
> > from the script. One way to do this is visit the closure, see this was a
> > constructor call to RetryParams, and use the numbers there. This seems
> > tedious given the number of combinations possible. However if there was way
> > for me to run this closure during the AST transform, I can inspect the
> > created retryparams object to get my values. Does that make sense?
> >
> > As I am typing this, I also realize that the closure may call other
> > functions which may need to be compiled as well (but I can create compile
> > errors there to keep it simple)
> >
>