clojure-spec

About: http://clojure.org/about/spec Guide: http://clojure.org/guides/spec API: https://clojure.github.io/spec.alpha/clojure.spec.alpha-api.html
Aleh Atsman 2020-12-07T16:41:16.463300Z

Hello! Is there a way to get list of keys from (s/keys...) ? And if I had few specs merged can I get back a full list of keys? If not, how do you do it? Thx

Aleh Atsman 2020-12-09T15:20:10.474Z

explain data approach - maybe but clojure.spec/form - doesn't work for merged spec thanks for links

Aleh Atsman 2020-12-09T15:20:55.474200Z

both ways feels more hacky than just abstracting clojure.spec away and managing things by hands

misha 2020-12-09T15:33:09.477Z

For merged specs probably need to walk it doing s/form and s/registry. Walking datastructures ain’t hacky in a Lisp :op:

misha 2020-12-09T15:35:12.477900Z

They say spec2 is gonna be easier in this regard, fwiw

Aleh Atsman 2020-12-07T17:37:13.466400Z

Well, I am simple guy and solved my problem with first creating entities as plain maps, later wrapping decision on what fields to use in 2 level multimethods, only from there creating spec, and returning it together with fields 🙂