robert-hooke
robert-hooke copied to clipboard
Why not just use `hooks` instead of `#'hooks`?
Why not just use hooks
instead of #'hooks
? It's likely that the hooks
function will change dynamically.
(defmacro with-hooks-disabled [f & body]
`(do (when-not (#'hooks (var ~f))
(throw (Exception. (str "No hooks on " ~f))))
(with-redefs [~f (#'original (var ~f))]
~@body)))