cljs.spec.test/unstrument
macro | removed v1.9.542 | added v1.9.183 | Edit |
(unstrument)
(unstrument sym-or-syms)
Source docstring:
Undoes instrument on the vars named by sym-or-syms, specified
as in instrument. With no args, unstruments all instrumented vars.
Returns a collection of syms naming the vars unstrumented.
(defmacro unstrument
([]
`(unstrument '[~@(deref instrumented-vars)]))
([sym-or-syms]
(let [syms (sym-or-syms->syms (eval sym-or-syms))]
`(reduce
(fn [ret# f#]
(let [sym# (f#)]
(cond-> ret# sym# (conj sym#))))
[]
[~@(->> syms
(map
(fn [sym]
(when (symbol? sym)
`(fn []
(unstrument-1 '~sym)))))
(remove nil?))]))))