Skip to content

Instantly share code, notes, and snippets.

@tyre
Created July 6, 2012 17:52
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 tyre/3061613 to your computer and use it in GitHub Desktop.
Save tyre/3061613 to your computer and use it in GitHub Desktop.
(defmacro create-tag-fn [tag-name]
`(def css-str (atom ""))
(defn (symbol ~tag-name) [properties]
(apply (fn [k v]
(swap! css-str
(str @css-str " " k ": " v "; ")))
(seq properties))))
@tyre
Copy link
Author

tyre commented Jul 6, 2012

Now calling (create-tag-fn "a") yields java.lang.Exception: First argument to def must be a Symbol, as does (create-tag-fn :a)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment