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

Support the method inject() on arrays

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.0-JSR-3
    • None
    • 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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment