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

Allow Closures to be lazily evaluated in GStrings

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0
    • 1.1-beta-1
    • groovy-jdk
    • None

    Description

      When a Closure is a value in a GString do the following when the GString is printed or has toString called on it.

      If the Closure takes 0 parameters then call the Closure and use the returned value as the value at that point in the GString

      If the Closure takes 1 parameter then call the Closure with a Writer as the parameter and use the characters written to the Writer as the value at that point in the GString

      If the Closure takes more that one parameter throw a GroovyRuntimeException.

      Attachments

        Activity

          People

            tug John Wilson
            tug John Wilson
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: