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

Unless / If expressions support

    XMLWordPrintableJSON

Details

    • Wish
    • Status: Closed
    • Minor
    • Resolution: Information Provided
    • None
    • None
    • syntax
    • None

    Description

      I would love to see Groovy support right-side unless / if expressions like in Python or Ruby as they make the code often more readable.

      Here is a small example:

      doSomething() unless (x > 10)
      
      (...)
      
      triggerSomethingNasty() if (x < 10)
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            jponge Julien Ponge
            Votes:
            4 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: