Fork me on GitHub

is it reasonable to spec the first two args of partition as pos-int? instead of nat-int?

user=> (partition 2 1 (range 5))
((0 1) (1 2) (2 3) (3 4))
user=> (partition 2 0 (range 5))
;; same as (repeat '(0 1))
user=> (partition 0 1 (range 5))
user=> (partition 0 1 (range 5))
(() () () () ())


@alexmiller why? the behavior of using 0 or even negative ints would be useful in certain situations?

Alex Miller (Clojure team)15:02:26

it’s current supported behavior, so I don’t think you should exclude it

Alex Miller (Clojure team)15:02:53

I don’t know why you’d end up doing this :)


OK, so also negative ints then. int? it is… Do you also have an opinion on flatten? It is currently spec’ed as taking a sequential, but it basically works on anything, it just returns an empty seq for anything that’s not.


I wound up correcting a whole of of 4clojure solutions that “abused” flatten, because sequential? was a forbidden function

Alex Miller (Clojure team)15:02:38

dunno, don’t have time to do the work to answer that atm


alright, I’ll relax the partition specs a little bit then. thanks

Alex Miller (Clojure team)15:02:19

thx for trying the spec stuff too, I’ll look at it later today


I checked all specs with coal-mine now, including the ret+fn specs (using orchestra). I updated coal-mine where necessary. So I think we should have a fairly stable set of specs now for the next release. Friday seems a good day to release 0.0.3.


The only thing I’d like to do before the release is do a test-run on Advent of CLJC and update the release notes. Any additional testing on your code bases would be appreciated!