Fork me on GitHub
Garrett Hopper02:04:34

Is it possible for me to have a spec: s/cat regex where latter parts of the regex use predicates that depend on the conform of prior parts?

Garrett Hopper02:04:29

I guess the alternative would be to have a second spec to run after the first one, so it can depend on the output of the first one.


If you had some spec'd code where correctness was far more important than performance, a) would it make sense to turn on instrumentation of every fn at production runtime and b) if so, how would one go about doing that?


@cap10morgan instrument accepts a sequence of symbols to instrument as I recall. You'd probably want to just instrument the functions in specific namespaces (your own) to avoid turning on instrumentation for all libraries functions in your app.


(you can "instrument everything" by calling instrument with no arguments but you wouldn't know what functions got instrumented so you'd have no idea about performance impact)

Alex Miller (Clojure team)17:04:16

you would know as it returns a collection of all symbols instrumented


I meant, ahead of time.

Alex Miller (Clojure team)17:04:50

you do have to ensure the specs have been loaded (by requiring them) before calling instrument


But, yeah, you could potentially get a very long list of instrumented functions that you weren't expecting 🙂