3 ms·
Does core.spec add anything here? I stopped Clojure a while back due to this problem but was considering trying again if spec helps.
by daxfohl 8y ago
Does core.spec add anything here? I stopped Clojure a while back due to this problem but was considering trying again if spec helps.
- robto 8y agoYes, in my experience it does. In my projects I fdef all my functions and then turn on instrumentation (with the Orchestra[0] library, so that it also checks :ret specs). It helped me find several instances where I was incorrectly assuming that I would never get nil as an input. Couple it with Expound[1] to make reading the spec errors a bit easier, and you've got a much better story for handling nil in Clojure. [0]https://github.com/jeaye/orchestra https://github.com/jeaye/orchestra [1]https://github.com/bhb/expound https://github.com/bhb/expound