Fork me on GitHub

That the incoming values will be in that set when conformed, and that strings will be conformed to keywords.


I'm trying to make my example more DRY.

Alex Miller (Clojure team)00:05:45

(def vs #{:some :specific :values}) (s/def ::example (into vs (map name) vs))

Alex Miller (Clojure team)00:05:33

That doesn't conform to keywords but transformation is not really the point of spec


does anyone know of any efforts that present clojure spec validation errors in a nice way? I’m looking for ideas and inspiration for a web based error message component I’m working on


@odinodin just spent some time looking into the same issue, found this and can recommend this approach


@rmuslimov thanks. I was thinking more about how to present raw clojure.spec validation errors in a nicer way during development


ah ok, interesting. Not sure how standard can be improved, may be you already have any ideas - how it may look like?


Just started digging, not sure where it will lead yet


why has cljs.spec been renamed to cljs.spec.alpha?


Any news on or something similar? Having some issues right now with name clashes on specs (that we still want in the same file). We're specing a re-frame db and want to keep the specs for a specific page in the same file. Often parts of specs for input field and similar end up having the same names as other parts of the state. The solution right now is either to create an artificial and verbose namespaced keyword (:my-page.input.domain/id) or to add a new file just for the clashing specs.


@curlyfry in a similar vein: when you refactor clashing keywords to have different namespaces, does the rename mean that you get rippling changes throughout your code?


I've got a map where all entries should follow some template (e.g. (s/map-of string? number?) except one optional key, let's call it :foo. I tried something like s/merge, but it seems like it was designed with multiple s/keys specs in mind. (s/merge (s/map-of string? number?) (s/keys :opt-un [::foo])). I can of course write my own predicate function to split the map in two and check against each spec with s/valid?, but I'll lose a lot of contextual information in case of failures. Is there no better way ?

Alex Miller (Clojure team)15:05:13

yours is a bit simpler than the one described there


@alexmiller cool, a bit too tired to digest, but bookmarked.


Hey, does (s/exercise) work with CLJS?


do I need to import anything else apart from cljs.spec?


Fixed it. Need to import [clojure.test.check.generators]. I was only using Spacemacs inline eval I wasn’t looking at the REPL.