Skip to content

Instantly share code, notes, and snippets.

@tgk
Created May 20, 2010 10:58
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 tgk/407456 to your computer and use it in GitHub Desktop.
Save tgk/407456 to your computer and use it in GitHub Desktop.
(def todo-log (ref []))
(defn save-code-and-snippet [comment code-str]
(dosync (alter todo-log conj [comment code-str])))
(defmacro todo
[comment form]
(do
(save-code-and-snippet comment (str form))
form))
(println
(map #(todo "Bad function!" (inc %)) (range 10)))
(defn lousy-function
[param-1 param-2]
(do
(println "doing one thing here")
(todo
"This part looks ugly"
(map param-1 (repeat param-2))
)
(println "a third thing here")))
(println (deref todo-log))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment