source is a Clojure macro for inspecting the original source text of a public definition at the REPL. It belongs to clojure.repl, whose source- and environment-oriented tools complement documentation and exception utilities. section 22.3
Inspect a definition
(source unchecked-inc-int) ;; (defn unchecked-inc-int ;; "Returns a number one greater than x, an int." ;; {:inline ... :added "1.0"} ;; [x] (. clojure.lang.Numbers (unchecked_int_inc x))) The printed result exposes the definition, documentation, metadata, arguments, and implementation. section 22.3
Choose the related form according to the desired result:
- Use source for direct, readable printing at the REPL. section 22.3
- Use source-fn when the source text must be returned as a string for further manipulation or printing. section 22.3
