groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guillaume Laforge <glafo...@gmail.com>
Subject Re: [PROPOSAL]new operator ?=
Date Tue, 22 Nov 2016 14:25:12 GMT
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 addition.

Guillaume

On Tue, Nov 22, 2016 at 3:14 PM, Daniel Sun <realbluesun@hotmail.com> 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?
>
> Cheers,
> Daniel.Sun
>
>
>
> --
> View this message in context: http://groovy.329449.n5.
> nabble.com/PROPOSAL-new-operator-tp5736886.html
> Sent from the Groovy Dev mailing list archive at Nabble.com.
>



-- 
Guillaume Laforge
Apache Groovy committer & PMC Vice-President
Developer Advocate @ Google Cloud Platform

Blog: http://glaforge.appspot.com/
Social: @glaforge <http://twitter.com/glaforge> / Google+
<https://plus.google.com/u/0/114130972232398734985/posts>

Mime
View raw message