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

Consider enhancing default string templates to support $foo or $!{foo}

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • Templating
    • None

    Description

      println "hello $user whats it like in $user.country.description today?"

      could make things a little simpler. Only should work for $identifer separated by whitespace. Otherwise ${} is required.

      Similarly its very common that if an expression is null, then folks don't want to output 'null'.

      So how about

      println "hey $!

      {user}

      "

      which would not print

      hey null

      if the user is null, rather it'd print

      hey

      Attachments

        Issue Links

          Activity

            People

              blackdrag Jochen Theodorou
              jstrachan James Strachan
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: