Fork me on GitHub
#clojure-spec
<
2018-12-28
>
borkdude09:12:13

I tried to write a generator for arguments to assoc. Not sure if this is the best way to get overrides for the generators: https://github.com/slipset/speculative/blob/master/src/speculative/core.cljc#L66

hmaurer21:12:34

Hey! How can I define mutually recursive specs? I tried (s/def :my/spec nil) but it doesn’t seem to work

taylor21:12:54

I think (in most cases?) it should work without you needing to register nil/dummy specs. Can you post a bigger example?

hmaurer21:12:33

@U3DAE8HMG sure!

(s/def :elogic.negation/operand :elogic/formula)
(s/def :elogic/negation (s/keys :req [:elogic.negation/operand]))
(where a formula is later defined by referencing :elogic/negation)

hmaurer21:12:11

actually sorry, I just realised in this specific case the formula definition can be hoisted above the negation definition, even thought it references it

jaihindhreddy-duplicate22:12:38

Here's a good example of mutually recursive specs by @U0FR82FU1