Fork me on GitHub
#clojure-spec
<
2016-09-05
>
ikitommi09:09:58

@alexmiller did you consider using Records instead of just doing reify for the Spec protocol? For example and-spec-impl could return clojure.spec.AndSpec record? Would it have negative effect on performance? Records might be easier to understand and adding extensions would be easier. Trying to cover the JSON Schema generation for the core Specs. Extending records with a new protocol would be easy (the way we are doing the same with Schema).

ikitommi10:09:26

Pushed out a experimental version of the dynamic conformations (based on runtime data). Would like to get feedback on that, now using dynamic var as the conform doesn’t take any optional parameters to do this. https://github.com/metosin/spec-tools

misha11:09:30

greetings, is there an equivalent to clojure.spec/def, for defining many specs? like:

(s/def ::first-name string?)
(s/def ::last-name string?)
->>
(s/def-many
  ::first-name string?)
  ::last-name string?)

madstap12:09:07

(defmacro def-many [& key-spec-pairs]
  (cons 'do (for [[k spec] (partition 2 key-spec-pairs)]
              `(s/def ~k ~spec))))

misha12:09:31

@madstap 🙂 is there any popular use case, of using return value of s/def?