Fork me on GitHub
#speculative
<
2019-02-06
>
borkdude14:02:13

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))
(() () () () ())

alexmiller15:02:51

I would say no

borkdude15:02:27

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

alexmiller15:02:26

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

alexmiller15:02:53

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

borkdude15:02:44

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.

borkdude15:02:26

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

alexmiller15:02:38

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

borkdude15:02:12

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

alexmiller15:02:19

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

borkdude22:02:36

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.

borkdude22:02:36

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!