Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-4874

Elvis assignment operator

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • None
    • None
    • syntax
    • None

    Description

      It would be nice to have an operator similar to the Elvis operator but for assignments.

      a ?= b
      

      as a shorthand for

      a = b ?: a
      

      I'm not a Ruby expert but from the Groovy mailing list it sounds like Ruby has an operator like this.

      Attachments

        Issue Links

          Activity

            People

              daniel_sun Daniel Sun
              balor123 Uri Moszkowicz
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: