Fork me on GitHub
#clojure-spec
<
2019-06-09
>
misha06:06:19

I completely agree with your complaint. But it works! kappa

misha06:06:21

(went with loop+case and weaker jit errors instead of spec for such tree this time, though)

misha07:06:26

further destructuring of a form conformed to regex-spec and to or-spec is different: map vs "twople". In case of a tree, you'll walk 1 node at a time, which makes

(let [[tag form] conformed]
  (case tag ...))
preferable to
(let [{:keys [tag1 tag2 tag3 ...]} conformed]
  (cond ;; I guess?
    tag1 ...
    tag2 ...))

misha07:06:52

but latter brings the same edge cases as (contains? #{...} x) vs. just (#{...} x): nil, false