Skip to content

Instantly share code, notes, and snippets.

@fconcklin
Created April 25, 2011 23:18
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 fconcklin/941466 to your computer and use it in GitHub Desktop.
Save fconcklin/941466 to your computer and use it in GitHub Desktop.
marginalia macro behavior
(ns cljsh.core)
(defmacro dbg [x] `(let [x# ~x] (println '~x "=" x#)
x#))
(defn pythag [ x y] (* (* x x)
(* y y)))
(defn pythag [ x y] (dbg (* (dbg (* x x))
(dbg (* y y)))))
(pythag 4 5)
######################
fred@ryleh:~/src/cljsh$ lein marg
Generating uberdoc for the following source files:
/home/fred/src/cljsh/./src/cljsh/core.clj
(* x x) = 16
(* y y) = 25
(* (dbg (* x x)) (dbg (* y y))) = 400
Done generating your documentation, please see ./docs/uberdoc.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment