This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-02-06
Channels
- # adventofcode (1)
- # aleph (9)
- # announcements (22)
- # beginners (59)
- # boot (8)
- # calva (1)
- # cljdoc (7)
- # cljs-dev (10)
- # cljsrn (9)
- # clojars (10)
- # clojure (23)
- # clojure-dev (6)
- # clojure-europe (3)
- # clojure-italy (26)
- # clojure-nl (3)
- # clojure-seattle (1)
- # clojure-spec (46)
- # clojure-uk (85)
- # clojurescript (97)
- # core-async (13)
- # cursive (3)
- # data-science (10)
- # datomic (156)
- # duct (34)
- # emacs (37)
- # figwheel (3)
- # figwheel-main (9)
- # fulcro (59)
- # hyperfiddle (4)
- # immutant (1)
- # jackdaw (3)
- # jobs (1)
- # off-topic (112)
- # parinfer (1)
- # qlkit (2)
- # re-frame (1)
- # reagent (35)
- # ring-swagger (2)
- # shadow-cljs (104)
- # spacemacs (9)
- # speculative (12)
- # tools-deps (30)
- # yada (10)
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))
(() () () () ())
I would say no
@alexmiller why? the behavior of using 0 or even negative ints would be useful in certain situations?
it’s current supported behavior, so I don’t think you should exclude it
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
dunno, don’t have time to do the work to answer that atm
thx for trying the spec stuff too, I’ll look at it later today