Fork me on GitHub

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?


I would start by adding fdefs for key functions


Maybe it's also a good idea to spec places where pieces of code, written by different people in the team, meet. To set expectations and settle future disputes.


there was this bit from stuart halloway: -- may be that's of some use?


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?


I dont think you should even need that?


yeah on a second thought it’s not very useful


Also because it would only apply to spec from simple predicates, not other types of specs


it already does what you're asking, unless I misunderstand what you're asking


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