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
valerauko 2019-12-19T16:23:05.000800Z

are there any tools to use spec for static checks?

alexmiller 2019-12-19T16:50:35.001200Z

there's https://github.com/arohner/spectrum

alexmiller 2019-12-19T16:51:27.001900Z

it's something that's inherently going to have limits, but I was surprised at how far it went

valerauko 2019-12-19T16:53:32.002400Z

awesome! and so many stars too! gonna dive in during the holidays

alexmiller 2019-12-19T16:54:31.002700Z

there's a talk about it from Conj a couple years ago too

alexmiller 2019-12-19T16:55:41.002900Z

https://www.youtube.com/watch?v=hzV7dFYmbAs

💯 1
🦜 1
joefromct 2019-12-19T18:06:56.004600Z

if i just type into a repl a fn and a fdef, is there any reason it wouldn't be enforced for a given project? I have an older project I'm jumping into and can't understand why my fdef's aren't throwing errors... I'm sure check-asserts is true although i didn't think that would even matter.

alexmiller 2019-12-19T18:22:20.004800Z

fdef on macro or function?

alexmiller 2019-12-19T18:22:32.005100Z

if function, you have to instrument it for it to do anything

joefromct 2019-12-19T18:24:10.006300Z

ok, so runtime checks have to be inside the form... either with an assertion, :pre check, or conform. I guess i missed that in the gude... I think i'll plug in an assertion so i can turn it off when i'm done with my test/dev/exploration on trying to figure out these data structures.

joefromct 2019-12-19T18:24:33.006600Z

^ fdef on a function

alexmiller 2019-12-19T18:51:49.006800Z

note that there is a s/assert

joefromct 2019-12-19T18:54:01.007400Z

thanks as always for your help Alex