Clojure

split IReduce

Details

  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: Release 1.7
  • Component/s: None
  • Labels:
    None
  • Patch:
    Code
  • Approval:
    Ok

Description

  • IReduceInit should take arity-2 version from existing IReduce
  • IReduce should extend IReduceInit and add arity-1
  • new stuff should implement IReduceInit only (audit everything added for 1.7)
  • old stuff should not change or break

Patch: clj-1549-2.patch

  1. clj-1549.patch
    06/Oct/14 4:54 PM
    3 kB
    Alex Miller
  2. clj-1549-2.patch
    07/Oct/14 8:36 AM
    3 kB
    Alex Miller

Activity

Hide
Alex Miller added a comment -

Patch does as requested. Did not change the CollReduce extension which currently needs both arities:

(extend-protocol CollReduce
  ...

  clojure.lang.IReduce
  (coll-reduce
   ([coll f] (.reduce coll f))
   ([coll f val] (.reduce coll f val)))
Show
Alex Miller added a comment - Patch does as requested. Did not change the CollReduce extension which currently needs both arities:
(extend-protocol CollReduce
  ...

  clojure.lang.IReduce
  (coll-reduce
   ([coll f] (.reduce coll f))
   ([coll f val] (.reduce coll f val)))
Hide
Rich Hickey added a comment -

Can we please use the name IReduceInit instead of ILeftReduce?

Show
Rich Hickey added a comment - Can we please use the name IReduceInit instead of ILeftReduce?

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: