speculative

https://github.com/borkdude/speculative
borkdude 2019-02-06T14:49:13.208100Z

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 2019-02-06T15:02:51.208400Z

I would say no

borkdude 2019-02-06T15:05:27.208600Z

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

alexmiller 2019-02-06T15:17:26.209500Z

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

alexmiller 2019-02-06T15:17:53.210200Z

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

borkdude 2019-02-06T15:18:44.211200Z

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.

borkdude 2019-02-06T15:19:26.211700Z

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

alexmiller 2019-02-06T15:19:38.212Z

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

borkdude 2019-02-06T15:20:12.212300Z

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

alexmiller 2019-02-06T15:21:19.212600Z

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

borkdude 2019-02-06T22:34:36.214500Z

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.

borkdude 2019-02-06T22:36:36.215400Z

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!