Skip to content

Instantly share code, notes, and snippets.

@fronx
Created July 25, 2011 18:03
Show Gist options
  • Select an option

  • Save fronx/1104731 to your computer and use it in GitHub Desktop.

Select an option

Save fronx/1104731 to your computer and use it in GitHub Desktop.
; user=> (source source)
(defmacro source
"Prints the source code for the given symbol, if it can find it.
This requires that the symbol resolve to a Var defined in a
namespace for which the .clj is in the classpath.
Example: (source filter)"
[n]
`(println (or (source-fn '~n) (str "Source not found"))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment