Welcome! Please see the About page for a little more info on how this works.

+2 votes
in Java Interop by
user> (def al (hamf/array-list (range 200))) 
#'user/al
user> (type al)
java.util.ArrayList
user> (chunked-seq? (seq al))
false
user> (instance? java.lang.Iterable al)
trueSyntax error reading source at (REPL:65:41).
Unmatched delimiter: )
user> (instance? java.lang.Iterable al)
true
user> (chunked-seq? (clojure.lang.RT/seq al))
false
user> (chunked-seq? (clojure.lang.RT/chunkIteratorSeq (.iterator al)))
false
user> (type (clojure.lang.RT/chunkIteratorSeq (.iterator al)))
clojure.lang.LazySeq

If no lazy seq is a chunked seq then the result of clojure.core/map, filter, etc. also cannot ever be a chunked seq as they are currently written. There are just a whole lot of questions here.

by
If the above is true then the best answer by far is to remove chunking.  The core functions that matter can be written better, there are transducers and ham-fisted's lazy-noncaching namespace both of which provide lazy, noncaching programming model which is just faster than lazy-caching-threadsafe.
by
The seq of the seq is chunked...

user> (def data (seq al))
#'user/data
user> (type (seq data))
clojure.lang.ChunkedCons
by
The answer is the result of map, etc is a lazy seq.  Calling seq on this seq returns a chunkedcons (in the single-collection case) so (chunked-seq? (map ...)) will always be false but
(chunked-seq? (seq (map ...))) will sometimes be true.  It would still be ideal if (RT/chunkIteratorSeq ...) did in fact return a chunked seq.

1 Answer

+1 vote
by

Created CLJ-2821 to track this issue.

...