Clojure

`iterate` reducer

Details

  • Type: Enhancement Enhancement
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: Release 1.5
  • Fix Version/s: None
  • Component/s: None
  • Labels:
  • Patch:
    Code and Test
  • Approval:
    Vetted

Description

Added a reducer implementation mirroring clojure.core/iterate.

Patch: 0001-Add-reducers-iterate.patch

Screened by:

Activity

Hide
Alan Malloy added a comment -

Should I have made this implement Seqable as well? It wasn't clear to me, because as far as I could see this was the only function in clojure.core.reducers that's generating a brand-new sequence rather than transforming an existing one.

Show
Alan Malloy added a comment - Should I have made this implement Seqable as well? It wasn't clear to me, because as far as I could see this was the only function in clojure.core.reducers that's generating a brand-new sequence rather than transforming an existing one.
Hide
Alan Malloy added a comment -

Previous version neglected to include the seed value of the iteration in the reduce.

Show
Alan Malloy added a comment - Previous version neglected to include the seed value of the iteration in the reduce.
Alan Malloy made changes -
Field Original Value New Value
Attachment 0001-Add-reducers-iterate.patch [ 11192 ]
Alan Malloy made changes -
Attachment 0001-Add-reducers-iterate.patch [ 11191 ]
Hide
Jason Jackson added a comment -

Currying iterate seems useless, albeit not harmful.

While implementing repeat, I couldn't use currying. Because 1-arity is already reserved for infinite repeat ([n x] and [x], not [n x] and [n] if currying)

How about we just support currying for functions where last param is reducible?

Show
Jason Jackson added a comment - Currying iterate seems useless, albeit not harmful. While implementing repeat, I couldn't use currying. Because 1-arity is already reserved for infinite repeat ([n x] and [x], not [n x] and [n] if currying) How about we just support currying for functions where last param is reducible?
Rich Hickey made changes -
Approval Vetted [ 10003 ]
Fix Version/s Release 1.5 [ 10150 ]
Hide
Alan Malloy added a comment -

This new patch replaces the previous patch. As requested, I am splitting up the large issue CLJ-993 into smaller tickets.

Does not depend on any of my other reducer patches, but there will probably be some minor merge conflicts unless it is merged after CLJ-1045 and CLJ-1046, and before CLJ-993.

Show
Alan Malloy added a comment - This new patch replaces the previous patch. As requested, I am splitting up the large issue CLJ-993 into smaller tickets. Does not depend on any of my other reducer patches, but there will probably be some minor merge conflicts unless it is merged after CLJ-1045 and CLJ-1046, and before CLJ-993.
Alan Malloy made changes -
Attachment iterate-reducer.patch [ 11446 ]
Rich Hickey made changes -
Fix Version/s Release 1.5 [ 10150 ]
Alex Miller made changes -
Labels reducers
Alex Miller made changes -
Description Added a reducer implementation mirroring clojure.core/iterate. Added a reducer implementation mirroring clojure.core/iterate.

*Patch:* 0001-Add-reducers-iterate.patch

*Screened by:*

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated: