回复: Re: [PROPOSAL]new operator ?=

2016-11-22 Thread 孙 岚
Hi OC, OK. I understand your words :) About the new operator ?=, some like it, some do not, others say "huh…", so the feature will not be added until most of us want it ;) Cheers, Daniel.Sun --- 原始邮件 --- 发件人: o...@ocs.cz 已发: 2016年11月23日 11:25 收件人: dev@groovy.apache.org, "Daniel S

Re: [PROPOSAL]new operator ?=

2016-11-22 Thread o...@ocs.cz
Daniel, > On 23. 11. 2016, at 12:57 AM, Daniel Sun wrote: > ?= is similar with *=, +=, etc in their usage, and they are all for > convenience and readability. So if ?= does not make sense, why others does? > :-P Can't speak for Jochen of course, but I daresay the difference is that > a

回复: Re: [PROPOSAL]new operator ?=

2016-11-22 Thread Daniel Sun
Hi Jochen, ?= is similar with *=, +=, etc in their usage, and they are all for convenience and readability. So if ?= does not make sense, why others does? :-P a = a * 2 a *= 2 a = a ?: 2 a ?= 2 Cheers, Daniel.Sun --- 原始邮件 --- 发件人: "Jochen Theodorou [via Groovy]" 已发: 2016年11月23日 上午12:

Re: [PROPOSAL]new operator ?=

2016-11-22 Thread Shil Sinha
> > while I agree that ||= is more like what ruby offers we have the problem, > that for Groovy a||b always will be evaluated as boolean. > In fact first we apply groovy truth to a and if that is not true, we do > the same for b and if that is not true we return false, otherwise true. > Which means

Re: Negative relational operators for Groovy 3

2016-11-22 Thread Jim Jagielski
Agreed. > On Nov 22, 2016, at 6:44 AM, Guillaume Laforge wrote: > > I must confess I'm also a bit worried with those operators too. > For !in and !instanceof, I really like the idea, but here, it's closer to > Ascii art. > What others think? > > On Tue, Nov 22, 2016 at 12:35 PM, Cédric Champea

Re: [PROPOSAL]new operator ?=

2016-11-22 Thread Jochen Theodorou
hmm... actually you might be right there... sorry On 22.11.2016 17:46, Sébastien Le Callonnec wrote: Hi, On 2016-11-22 16:28:25, Jochen Theodorou wrote: you can unsusbscribe from the incubator list, we are not in incubator anymore Fair enough. I was under the impression the dev list was an

Re: [PROPOSAL]new operator ?=

2016-11-22 Thread Jochen Theodorou
On 22.11.2016 15:25, Guillaume Laforge wrote: It's a feature that's often be requested. I think Ruby's got an equivalent with ||=, and it's often the reference people give when exploring our Elvis operator coming from a ruby background in particular. I've had several opportunities where I could

Re: [PROPOSAL]new operator ?=

2016-11-22 Thread Sébastien Le Callonnec
Hi, On 2016-11-22 16:28:25, Jochen Theodorou wrote: > you can unsusbscribe from the incubator list, we are not in incubator > anymore Fair enough. I was under the impression the dev list was an alias of the incubator list created when the project graduated, but I was obviously mistaken. Thanks,

Re: Negative relational operators for Groovy 3

2016-11-22 Thread Roman Shaposhnik
On Tue, Nov 22, 2016 at 7:11 PM, Henrik Martin wrote: > -1. I never knew I was missing those operators. I think there's a huge > benefit to having a clean syntax. > +1 for !in and !instanceof though. Same here! Thanks, Roman.

Re: [PROPOSAL]new operator ?=

2016-11-22 Thread Roman Shaposhnik
On Tue, Nov 22, 2016 at 5:14 PM, Daniel Sun wrote: > Hi all, > > Marcin Erdmann proposed the new operator ?=, e.g. a ?= "foo" is > equivalent of a = a ?: "foo". > > I like his idea, what do you think about it? Like it! I could definitely see myself using it. Thanks, Roman.

Re: [PROPOSAL]new operator ?=

2016-11-22 Thread Jochen Theodorou
you can unsusbscribe from the incubator list, we are not in incubator anymore On 22.11.2016 16:03, Sébastien Le Callonnec wrote: Hi, Completely OT, but would it be possible not to cross-post on dev and incubator lists: I believe these are the same lists. I keep getting duplicate emails, in any

Re: Negative relational operators for Groovy 3

2016-11-22 Thread Henrik Martin
-1. I never knew I was missing those operators. I think there's a huge benefit to having a clean syntax. +1 for !in and !instanceof though. -Henrik On 11/22/16 3:44 AM, Guillaume Laforge wrote: I must confess I'm also a bit worried with those operators too. For !in and !instanceof, I really li

Re: [PROPOSAL]new operator ?=

2016-11-22 Thread Sébastien Le Callonnec
Hi, Completely OT, but would it be possible not to cross-post on dev and incubator lists: I believe these are the same lists. I keep getting duplicate emails, in any case. Thanks! ;) (Back on topic, `?=` is a good idea – call it the “ionic column” operator) Regards, Sébastien. On 2016-11-22 14

Re: [PROPOSAL]new operator ?=

2016-11-22 Thread Andres Almiray
Mr.G. I'm afraid ?= is closer to ?. than ?: hence why "my vote" would be to use ||= --- Java Champion; Groovy Enthusiast http://jroller.com/aalmiray http://www.linkedin.com/in/aalmiray -- What goes up, must come down. Ask any system administrator. There are

Re: [PROPOSAL]new operator ?=

2016-11-22 Thread Guillaume Laforge
But Elvis operator users won't relate to ||=, whereas they see the analogy between ?: and ?=. It's still Elvis "?:-)" On Tue, Nov 22, 2016 at 3:30 PM, Sergei Egorov wrote: > +1 for ||= > > Very convenient operator, doesn't break readability (more or less) > > On Tue, Nov 22, 2016 at 4:25 PM Guil

Re: [PROPOSAL]new operator ?=

2016-11-22 Thread Andres Almiray
I think ||= conveys the exact meaning of the operand whereas ?= is missing the : to properly indicate that's a shorthand for Elvis. ?:= would be a walrus sporting a pompaduor if you ask me ;-) --- Java Champion; Groovy Enthusiast http://jroller.com/aalmiray

Re: [PROPOSAL]new operator ?=

2016-11-22 Thread Sergei Egorov
+1 for ||= Very convenient operator, doesn't break readability (more or less) On Tue, Nov 22, 2016 at 4:25 PM Guillaume Laforge wrote: > It's a feature that's often be requested. > I think Ruby's got an equivalent with ||=, and it's often the reference > people give when exploring our Elvis ope

Re: [PROPOSAL]new operator ?=

2016-11-22 Thread Guillaume Laforge
It's a feature that's often be requested. I think Ruby's got an equivalent with ||=, and it's often the reference people give when exploring our Elvis operator coming from a ruby background in particular. I've had several opportunities where I could've used this operator. It might make for a nice a

[PROPOSAL]new operator ?=

2016-11-22 Thread Daniel Sun
Hi all, Marcin Erdmann proposed the new operator ?=, e.g. a ?= "foo" is equivalent of a = a ?: "foo". I like his idea, what do you think about it? Cheers, Daniel.Sun -- View this message in context: http://groovy.329449.n5.nabble.com/PROPOSAL-new-operator-tp5736886.html Sent from

Re: Negative relational operators for Groovy 3

2016-11-22 Thread Søren Berg Glasius
-1 from me. Does not add pure value to the language, more like confusion. the !in and !instanceof are clear wins however. Best regards, Søren Berg Glasius Hedevej 1, Gl. Rye, 8680 Ry, Denmark Mobile: +45 40 44 91 88, Skype: sbglasius --- Press ESC once to quit - twice to save the changes. From:

Re: Negative relational operators for Groovy 3

2016-11-22 Thread Guillaume Laforge
I must confess I'm also a bit worried with those operators too. For !in and !instanceof, I really like the idea, but here, it's closer to Ascii art. What others think? On Tue, Nov 22, 2016 at 12:35 PM, Cédric Champeau wrote: > I find this very hard to decipher. The fact we wonder about the seman

Re: Negative relational operators for Groovy 3

2016-11-22 Thread Cédric Champeau
I find this very hard to decipher. The fact we wonder about the semantics is a red warning to me. I wouldn't add those to the language. Le 22 nov. 2016 12:18, "Daniel Sun" a écrit : > Hi Jochen, > > According to your proposals, I'm going to add the following operators: > > 1) !&& a !&&

Groovy : Compare SOAP Response with XML file

2016-11-22 Thread hamami
0down votefavorite I want to compare in groovy code my Soap Response with xml file ignoring order :Here is my code :import org.custommonkey.xmlunit.Stuffimport org.xmlunit.Stuff//ExpectedString is my xml converted to text, same for ResponseStringDiff diff = DiffBuilder.compare(ExpectedString)

Re: Negative relational operators for Groovy 3

2016-11-22 Thread Daniel Sun
Hi Jochen, According to your proposals, I'm going to add the following operators: 1) !&& a !&& b === !(a && b) 2) !||a !|| b === !(a || b) 3) !& a !& b === !(a & b) 4) !| a !| b === !(a | b) 5) ~& a ~& b === ~(a & b) 6) ~| a ~| b === ~(a | b)