Fork me on GitHub
#clojure-spec
<
2021-08-16
>
vlaaad05:08:38

I know how it operates, I just find it limiting

vlaaad05:08:21

Because to check if something is a regex I have to do (s/regex? (or (s/get-spec spec) spec)) instead of just (s/regex? spec)

vlaaad06:08:01

(s/form (s/keys* :req-un [::foo]))
=> (clojure.spec.alpha/&
    (clojure.spec.alpha/*
     (clojure.spec.alpha/cat
      :clojure.spec.alpha/k
      clojure.core/keyword?
      :clojure.spec.alpha/v
      clojure.core/any?))
    :clojure.spec.alpha/kvs->map
    mspec__2546__auto__)
that doesn't look right...

dgb2307:08:56

You’re looking at an expanded macro.

vlaaad07:08:38

s/form for other specs, that are also implemented as macros, return the form used in code

Alex Miller (Clojure team)12:08:21

This is a known issue that’s addressed in spec 2

🎉 6