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
Ben Sless 2020-03-26T06:14:15.008100Z

I have a bit of a philosophical question: I watched several talks about spec and it's pretty clear how you'd use it for domain modelling when starting from scratch, but several mentioned its benefits in speccing an existing codebase. Any tips on where and how to start with speccing an existing code base?

robertfw 2020-03-26T06:34:51.009200Z

I would start by adding fdefs for key functions

2020-03-26T07:12:58.009800Z

there was this bit from stuart halloway: http://blog.cognitect.com/blog/2017/6/19/improving-on-types-specing-a-java-library -- may be that's of some use?

bertofer 2020-03-26T22:02:07.012600Z

Hi, does clojure-spec provide or will provide a way to convert schema maps (unqualified) without explicitly specifying spec on every val? e.g.

From (spec/schema {:type #{:open :closed}}) -> (spec/schema {:type (spec/spec #{:open :closed})})
Seems like a map traversal, is it something that can already be done with normal clojure on the context of spec and schemas?

alexmiller 2020-03-26T23:39:16.013600Z

I dont think you should even need that?

bertofer 2020-03-27T10:41:31.014300Z

True, I was confused by this in the schema and select wiki [::a ::b {:c (s/spec int?)}] , but in the unqualified keys section is shown as I wanted