Skip to content

Instantly share code, notes, and snippets.

@mwmitchell
Created June 17, 2011 12:46
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 mwmitchell/1031351 to your computer and use it in GitHub Desktop.
Save mwmitchell/1031351 to your computer and use it in GitHub Desktop.
(def servers {})
(def default-core :production)
(defmacro with-server
"Execute body with the *server* binding set"
([body] (with-server default-core body))
([server-name & body]
`(binding [*server* (~server-name *servers*)]
~@body)))
;; results in: java.lang.IllegalArgumentException: Wrong number of args (2) passed to: solr$with-server (NO_SOURCE_FILE:0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment