clojure-spec

vlaaad 2021-08-16T05:01:38.049900Z

I know how it operates, I just find it limiting

vlaaad 2021-08-16T05:14:21.050200Z

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)

vlaaad 2021-08-16T06:39:01.050700Z

(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...

dgb23 2021-08-16T07:01:56.051500Z

You’re looking at an expanded macro.

vlaaad 2021-08-16T07:21:38.051700Z

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

dgb23 2021-08-16T08:41:01.052Z

right!

Alex Miller (Clojure team) 2021-08-16T12:45:21.053Z

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

🎉 2