```Hi Jochen,

?=3D is similar with *=3D, +=3D, etc in their usage, and they are a=
ll for convenience and readability. So if ?=3D does not make sense, why oth=
ers does?  :-P

a  =3D a * 2
a *=3D 2

a  =3D a ?: 2
a ?=3D 2

Cheers,
Daniel.Sun

--- =E5=8E=9F=E5=A7=8B=E9=82=AE=E4=BB=B6 ---

=E5=8F=91=E4=BB=B6=E4=BA=BA=EF=BC=9A "Jochen Theodorou [via Groovy]&qu=
ot; <ml-node+[hidden email]=
>
=E5=B7=B2=E5=8F=91=EF=BC=9A 2016=E5=B9=B411=E6=9C=8823=E6=97=A5 =E4=B8=8A=
=E5=8D=8812:47
=E6=94=B6=E4=BB=B6=E4=BA=BA=EF=BC=9A "Daniel Sun" <[hidden email]>
=E4=B8=BB=E9=A2=98=EF=BC=9A Re: [PROPOSAL]new operator ?=3D

```

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 ||=3D, and it's often the refere= nce
> 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 addition.

while I agree that ||=3D 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 a =3D a||b would not be equal to a ||=3D b if that is supposed =
to be the same as proposed for ?=3D.

What would come near to that is |, which is mapped to a method call to
"or". And then again, it has already a meaning for numbers, that = does
not fit.

So for me a new operator makes more sense. But frankly...

> def foo(x) {
>   return x ?: "empty"
> }

or even

> def foo(x) {
>   x =3D x ?: "empty"
>   return x
> }

vs.

> def foo(x) {
>   x ?=3D "empty"
>   return x
> }

Is that really worth it? Does it really improve readability that much?
Or maybe someone has a better example?

it is different for !in and !instanceof, because of the spacing and
because you may have them in complex expressions. But ?=3D is a statement <= br> and I would very much dislike this usage as expression.

For now I am -1 on this

bye Jochen