Skip to content

Instantly share code, notes, and snippets.

@deque-blog
Last active June 4, 2017 16:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deque-blog/8a542730e57c520b93b24e0ac5c35b07 to your computer and use it in GitHub Desktop.
Save deque-blog/8a542730e57c520b93b24e0ac5c35b07 to your computer and use it in GitHub Desktop.
(defmacro defn-log
[name bindings & body]
`(defn ~name ; Defined a function with `defn`
~bindings ; With the same argument as `defn` would
(println ; But with an added trace API call
~(compile-log-message name bindings))
~@body)) ; Before the body of the function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment