Re: [VOTE] new operator ?=

2016-11-24 Thread Henrik Martin
+1. -H On 11/23/16 7:59 AM, Daniel Sun wrote: Hi all, If the new operator ?= (e.g. a ?= 'foo' is equivalent of a = a ?: 'foo') were to be added to Groovy programming language, do you like it? (Yes: +1; No: -1; Not bad: 0) Cheers, Daniel.Sun -- View this message in context: http:/

Re: .with() variant that returns the original object

2016-11-08 Thread Henrik Martin
+1 for withThis or withValue and +10 for Jochen's overloading proposal if it's feasible. -1000 for tap. Completely nonsensical to me and makes me think of network tun/tap interfaces in Linux or something like that. Isn't the functionality a little bit like the Builder pattern more than a pipelin

Re: Requesting Advice for Groovy Approach for Unique Date Conversions

2016-05-09 Thread Henrik Martin
nd prepare it for the API's of libraries, and then do something useful with the output. Regards, Jerry Gerald R. Wiltse jerrywil...@gmail.com <mailto:jerrywil...@gmail.com> On Mon, May 9, 2016 at 8:02 PM, Henrik Martin <mailto:hen...@netgate.net>> wrote: What about creat

Re: Requesting Advice for Groovy Approach for Unique Date Conversions

2016-05-09 Thread Henrik Martin
What about creating a few utility methods around the standard Java 8 time/date classes already available in the JDK? I've had to do some date conversions myself recently, and found everything I needed in java.time.*. It seems to me like your task is mostly a format conversion. If so, the variou

Re: Groovy YAML support

2016-04-21 Thread Henrik Martin
I can see JSON and XML tools being part of Groovy core since it's used for a plethora of things in many different parts of the ecosystem. Having worked with Spring Boot for a while, I too found myself having to search for tools for YAML processing. Like several people have already suggested, Sn

Re: What am I missing with this Elvis operator expression?

2016-04-11 Thread Henrik Martin
ression. Elvis operator like this: Z = X ?: Default is equivalent to: Z = X ? X : Default not Z = X ? (some part of X) : Default On Mon, Apr 11, 2016 at 3:43 PM, Henrik Martin <mailto:hen...@netgate.net>> wrote: And of course I meant to say "... and my println sta

Re: What am I missing with this Elvis operator expression?

2016-04-11 Thread Henrik Martin
And of course I meant to say "... and my println statement prints 10", not 910. :-) -H On 4/12/16 12:41 AM, Henrik Martin wrote: Greetings. I ran into this little surprise with the Elvis operator today. I guess it must boil down to my misunderstanding of how the operator work

What am I missing with this Elvis operator expression?

2016-04-11 Thread Henrik Martin
Greetings. I ran into this little surprise with the Elvis operator today. I guess it must boil down to my misunderstanding of how the operator work. I have a method that tries to calculate a value based on an input. If the input value is set to -1, I'd like to change it to a positive value (whi

Re: building a jar from groovy script with gradle

2016-03-08 Thread Henrik Martin
projects to Big Data deployments. Cheers, -H On 3/8/16 9:08 AM, David Dawson wrote: good steer on shadowJar. I can confirm though that all you end up with is a couple of hundred kb of spring boot launcher. Nothing else spring is pulled in. On 8 March 2016 at 17:03, Henrik Martin <mailto:

Re: building a jar from groovy script with gradle

2016-03-08 Thread Henrik Martin
For "uber jars", I use both Spring Boot's bootRepackage, and shadowJar, the Gradle port of Maven Shadow. Both work really well and are easy to use from Gradle. The only thing about using Spring Boot is that you probably end up with a bunch of transient dependencies for Spring/Spring Boot that m