Uploaded image for project: 'Clojure'
  1. CLJ-1903

Provide a transducer for reductions

    Details

    • Type: New Feature
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects versions: Release 1.8
    • Fix versions: None
    • Labels:
    • Approval:
      Prescreened
    • Patch:
      Code and Test

      Description

      Reductions does not currently provide a transducer when called with a 1-arity.

      Proposed:

      • A reductions transducer with explicit initialization values: reductions-with
      • Do to arity conflicts, this is a separate function, not combined with reductions

      A second patch proposes a variant which allows explicit initialization values: reductions-with

      (assert (= (sequence (reductions-with + 0) [1 2 3 4 5]) [1 3 6 10 15])))
      

      Patch: 0003-add-reductions-with.patch

      Prescreened by: Alex Miller

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              pyr Pierre-Yves Ritschard
            • Votes:
              4 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: