This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-08-29
Channels
- # aleph (5)
- # announcements (2)
- # bangalore-clj (2)
- # beginners (52)
- # cider (10)
- # cljsrn (1)
- # clojure (160)
- # clojure-dev (24)
- # clojure-europe (3)
- # clojure-france (1)
- # clojure-india (1)
- # clojure-italy (3)
- # clojure-nl (6)
- # clojure-spec (13)
- # clojure-uk (51)
- # clojurescript (45)
- # code-reviews (1)
- # core-async (41)
- # cursive (41)
- # datomic (17)
- # emacs (37)
- # fulcro (42)
- # graphql (7)
- # joker (4)
- # music (1)
- # nrepl (2)
- # off-topic (21)
- # pathom (19)
- # pedestal (12)
- # re-frame (48)
- # reitit (6)
- # rewrite-clj (8)
- # shadow-cljs (41)
- # specter (6)
- # sql (21)
- # tools-deps (8)
- # vim (7)
- # xtdb (27)
is there a way to make a recursive spec to generate the output from clojure.data.xml ?
you might try limiting the collection sizes
(s/def ::attrs (s/map-of keyword? string? :gen-max 3))
(s/def ::content (s/coll-of ::a-content :kind vector? :gen-max 3))
oh, it's probably that the unqualified keys are foiling the recursion limiter
try it with :req and see if that works
hmm.. no luck with req and gen-max 3
(s/def ::tag keyword?)
(s/def ::attrs (s/map-of keyword? string? :gen-max 3))
(s/def ::a-content (s/keys :req [::tag ::attrs ::content] ))
(s/def ::content (s/coll-of ::a-content :kind vector? :gen-max 3))
(->> ::content
s/gen
gen/generate
(binding [s/*recursion-limit* 1]))
;;=> Execution error (StackOverflowError) at clojure.test.check.generators/tuple
;;(generators.cljc:534).
We have some open tickets about SO on recursive gen. I have not dug into any of them recently
i appreciate how you always try to respond when i’m sure your busy with strange loop very soon.
me too :)