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
2021-04-13T01:42:21.025800Z

are there ways to programmatically work with specs when the output of s/get-spec is an object, in some cases? are there ways folks approach this?

2021-04-13T01:42:41.026300Z

i'm seeing that i can't build up expressions programmatically out of existing specs

alexmiller 2021-04-13T01:43:12.026900Z

this is one of the big things addressed in spec 2 (via several different options) but it can be cumbersome to do in spec 1

alexmiller 2021-04-13T01:44:35.027700Z

in spec 1, one approach is to use macros to emit spec forms

alexmiller 2021-04-13T01:47:57.029500Z

the other option is to s/form a spec object (the result of s/get-spec) to get back to a form, then manipulate it as a collection, and either s/def or eval it

🤯 1
2021-04-13T01:49:49.029700Z

wow, ok! thank you!