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

auto-vivicate a Map to provide a closure to create new values.

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • None
    • 1.7.1
    • None
    • None

    Description

      Something like

      def m = [:]
      m = m.lazyCreate

      { key -> key * 2 }

      assert m[2] == 4
      assert m[4] == 8

      Attachments

        Activity

          People

            paulk Paul King
            jstrachan James Strachan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: