cljs.repl/source

macrosince v0.0-2985 clojure.repl/sourceEdit
(source n)

Details:

Prints the source code for the given symbol name, if it can find it. This requires that the symbol resolve to a Var defined in a namespace for which the .cljs is in the classpath.


Examples:

(source comment)
;; Prints:
;; (defmacro comment
;;   "Ignores body, yields nil"
;;   {:added "1.0"}
;;   [& body])
;;
;;=> nil

See Also:


Source docstring:
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 .cljs is in the classpath.

Example: (source filter)
Source code @ clojurescript:src/main/clojure/cljs/repl.cljc
(defmacro source
  [n]
  `(println ~(or (source-fn &env n) (str "Source not found"))))