This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-02-05
Channels
- # announcements (16)
- # babashka (10)
- # beginners (80)
- # calva (18)
- # cider (10)
- # clojure (96)
- # clojure-austin (1)
- # clojure-europe (52)
- # clojure-france (6)
- # clojure-germany (2)
- # clojure-italy (4)
- # clojure-nl (4)
- # clojure-seattle (3)
- # clojure-spec (4)
- # clojure-uk (25)
- # clojurescript (97)
- # community-development (2)
- # cursive (7)
- # datomic (13)
- # figwheel-main (5)
- # fulcro (13)
- # inf-clojure (1)
- # jobs (3)
- # off-topic (33)
- # pathom (10)
- # polylith (8)
- # re-frame (7)
- # reitit (8)
- # releases (1)
- # reveal (2)
- # ring (4)
- # ring-swagger (1)
- # sci (6)
- # shadow-cljs (102)
- # slack-help (1)
- # spacemacs (28)
- # tools-deps (9)
- # vim (1)
- # xtdb (3)
Hi, is there a better way to have a completely custom spec generator?
(let [my-custom-generating-fn #(do {:something (rand-int 100) :complicated (rand-int 200)})
g (gen/fmap #(%) (gen/return my-custom-generating-fn))]
(gen/generate g))
all the examples I found start from some primitive like (gen/int)
. Feels like what I was trying is intended to be difficult, is that because it doesn't follow some underlying random seed or something, or am I just missing the key bitCorrect - generally generators should control randomness, not introduce their own sources of randomness, as that makes it impossible to either shrink or regen from the same seed
very useful, thanks Alex