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

Support the method inject() on arrays

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0-JSR-3
    • Component/s: None
    • Labels:
      None

      Description

      Guillaume Laforge wrote:
      > I noticed inject() is not supported on arrays, though both each and
      > collect are supported.
      > For symetry sake, shouldn't we also implement inject on arrays?
      > Or should we just use arr.toList().inject(0)

      {i,j->i+j}

      ?

      +1

      --------------------------------------------------------
      phkim wrote:
      > Are you ready to mplement such an inject() ?A
      > If not, may I do so tonight?

      Feel free to do it!
      You can create a JIRA issue about it to allow us to track the changes
      we make (and for the release notes of the next release of Groovy).
      Thanks a lot for taking care of this.

        Attachments

          Activity

            People

            • Assignee:
              guillaume Guillaume Sauthier
              Reporter:
              phkim Kim, Pilho
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: