Welcome! Please see the About page for a little more info on how this works.

+2 votes
in Spec by
retagged by

[org.clojure/clojure "1.11.0-alpha2"]
clojure.spec.alpha

Repro (see or inside keys):

(s/def :x/foo int?)
(s/def :x/bar string?)

(s/form (s/keys :req-un [(or :x/foo :x/bar)]))
; => (clojure.spec.alpha/keys :req-un [(or :x/foo :x/bar)])

(s/form (s/and (s/keys :req-un [(or :x/foo :x/bar)])))
;=> (clojure.spec.alpha/and (clojure.spec.alpha/keys :req-un [(clojure.core/or :x/foo :x/bar)]))

Is there a way to force or to be namespaced in the first form?

1 Answer

+1 vote
by
selected by
 
Best answer

or here is just a symbol understood in the language of spec, it’s not a reference to the clojure.core/or function. It’s intentional that it’s not namespaced in the form.

by
So it shouldn't have namespace when `keys` is wrapped with `and`?
by
Oh, that's correct - I'd say the second one is wrong.
...