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

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.
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.
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.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated: