Skip to content

Instantly share code, notes, and snippets.

@ibdknox
Created June 27, 2011 21:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ibdknox/1049935 to your computer and use it in GitHub Desktop.
Save ibdknox/1049935 to your computer and use it in GitHub Desktop.
defpartial source
(defmacro defpartial
"Create a function that returns html using hiccup. The function is
callable with the given name."
[fname params & body]
`(defn ~fname ~params
(html
~@body)))
(defpartial hello [person]
[:p "Hello " person])
(hello "noir")
=>"<p>Hello noir</p>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment