You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Daniel Sun (JIRA)" <ji...@apache.org> on 2017/02/02 05:10:51 UTC
[jira] [Closed] (GROOVY-4874) Elvis assignment operator
[ https://issues.apache.org/jira/browse/GROOVY-4874?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Daniel Sun closed GROOVY-4874.
------------------------------
Resolution: Duplicate
Fix Version/s: 3.0
> Elvis assignment operator
> -------------------------
>
> Key: GROOVY-4874
> URL: https://issues.apache.org/jira/browse/GROOVY-4874
> Project: Groovy
> Issue Type: Improvement
> Components: syntax
> Reporter: Uri Moszkowicz
> Assignee: Daniel Sun
> Priority: Minor
> Fix For: 3.0
>
>
> It would be nice to have an operator similar to the Elvis operator but for assignments.
> {code}
> a ?= b
> {code}
> as a shorthand for
> {code}
> a = b ?: a
> {code}
> I'm not a Ruby expert but from the Groovy mailing list it sounds like Ruby has an operator like this.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)