Clojure

ArrayChunk implements Seqable

Details

  • Type: Enhancement Enhancement
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Patch:
    Code and Test

Description

I've found it helpful to be able to iterate over ArrayChunks. Implementing Seqable means they can be used by most collections functions.

Activity

Jim Blomo made changes -
Field Original Value New Value
Description I've found it helpful to be able to iterate over ArrayChunks. Implementing ISeq means they can be used by most collections functions. I've found it helpful to be able to iterate over ArrayChunks. Implementing Seqable means they can be used by most collections functions.
Summary ArrayChunk implements ISeq ArrayChunk implements Seqable
Hide
Jim Blomo added a comment -

2012-05-28 implements the seq method for vec and vector-of. It uses the array backing ArrayChunk to construct a sequence. Simple tests are included.

Show
Jim Blomo added a comment - 2012-05-28 implements the seq method for vec and vector-of. It uses the array backing ArrayChunk to construct a sequence. Simple tests are included.
Jim Blomo made changes -
Attachment arraychunk-seq-10004.diff [ 11264 ]
Jim Blomo made changes -
Patch Code and Test [ 10002 ]
Hide
Stuart Halloway added a comment -

Please add discussion of motivating use cases.

Show
Stuart Halloway added a comment - Please add discussion of motivating use cases.
Stuart Halloway made changes -
Fix Version/s Release 1.5 [ 10150 ]
Hide
Jim Blomo added a comment -

This was motivated by the desire to implement chunk-sequence-aware functions in Clojure elegantly. Currently, dealing with ArrayChunks in Clojure is clumsy because few of the functions dealing with collections will work with non-seqables. This functionality will mostly be used by implementers since end users shouldn't care if their sequence is chunked or not.

Show
Jim Blomo added a comment - This was motivated by the desire to implement chunk-sequence-aware functions in Clojure elegantly. Currently, dealing with ArrayChunks in Clojure is clumsy because few of the functions dealing with collections will work with non-seqables. This functionality will mostly be used by implementers since end users shouldn't care if their sequence is chunked or not.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated: