Fork me on GitHub
#clojure-spec
<
2017-08-12
>
mattly05:08:08

I’m trying to migrate a project from pre clojure.spec.alpha to post-that, and I get this error:

mattly05:08:00

nowhere in the project is clojure.spec.gen.alpha referenced directly

mattly05:08:08

I’m on clojure 1.9-alpha17

mattly05:08:10

any ideas?

mattly05:08:37

hm, apparently I had a clojure version mismatch somewhere

mattly05:08:41

its working now I think

danielstockton08:08:22

Is it possible to remove all conforming on a spec so that it just returns identity (but still does the validation)?

mpenet08:08:45

With a conformer that calls unform? (yuk)

mpenet08:08:45

Sounds like the wrong solution to the pb. Maybe you need to decompose upstream spec(s) to build this kind of things

danielstockton09:08:09

Came to what I think is a better solution.

misha11:08:07

@danielstockton clojure.spec.alpha/nonconforming

(defn ^:skip-wiki nonconforming
  "takes a spec and returns a spec that has the same properties except
  'conform' returns the original (not the conformed) value. Note, will specize regex ops."
  [spec]

Alex Miller (Clojure team)21:08:25

As a note here, this was intentionally left out of the docs (the “skip-wiki” meta) because Rich is still mulling whether to include it. Some time has passed since we last talked about it, but at this point I think we should either keep it, or we should have a nonconforming version of s/or (which is the really common case where you want it).

misha19:08:17

TIL, regular-expression specs work like splicing, so nested reg-ex specs expect flat data structure dafuq

misha19:08:27

I read guide like 7 times already, and missed it complitely

Alex Miller (Clojure team)21:08:49

tbh, it took me like flubbing this like 5 times before I really knew it

Alex Miller (Clojure team)21:08:12

and I even wrote 2 implementations of it before the current one!

misha21:08:46

the spec is still alpha thing makes more sense now troll