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

+2 votes
in Docs by

partition-all currently states that it returns a collection of lists. Though, when using as a transducer it returns vectors.

2 Answers

0 votes
by

Comment made by: pbwolf

There is more than a decorative difference between lists and vectors!

This does not seem like a doc bug. The transducer flavor of the function fails to meet a well-stated contract.

In the alternative, that it is just a doc bug and it's OK for partition-all to produce lists sometimes and vectors sometimes, based on a subtle configuration of your program, which you might change for computational reasons, with the nature of the returned structures farthest from your mind, thereby inadvertently up-ending all of your downstream conj's... then the doc bug is essentially that the docs have, all these years, over-stated an internal implementation detail by promising lists, and the safe way to consume the result of partition-all would be with sequence functions only.

by
yes, the docstring has overstated what you should expect all these years. The transducer is new so making it different breaks no existing code.
0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJ-2329 (reported by aralo)
...