In the compojure library in the core namespace, I see the following form:
(defn- compile-route "Compile a route in the form (method path & body) into a function." [method route bindings body] `(#'if-method ~method (#'if-route ~(prepare-route route) (fn [request#] (let-request [~bindings request#] (render (do ~@body) request#)))))) and
(defmacro GET "Generate a GET route." [path args & body] (compile-route :get path args body)) Further up in the file, the if-method and if-route functions are defined with defn-s.
I don't understand the meaning of the #' in this compile-route function though. The docs for (var ...) says:
The symbol must resolve to a var, and the Var object itself (not its value) is returned. The reader macro #'x expands to (var x).
But to me, in the context of what is happening (ie being called from a defmacro), it just sounds like it means the value of the symbol will be returned, which is the same as what substitutability sounds like:
(def x 5) (+ x 7) -> 12 ie, (+ x 7) expands to, or is the same as, (+ 5 7)
What am I missing here?