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

Add binary operator

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • syntax
    • None

    Description

      The ternary operator exists as shorthand for if()/else. It would be nice if there were an equivalent operator for just if().

      Ternary operator:
      if (a) b else c => a ? b : c

      Binary operator:
      if (a) b => a ? b

      Attachments

        Activity

          People

            Unassigned Unassigned
            balor123 Uri Moszkowicz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: