Created
May 20, 2010 10:58
-
-
Save tgk/407456 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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