1.3.0 permalink Arrow_down_16x16

*print-suppress-namespaces*

clojure.pprint

Don't print namespaces with symbols. This is particularly useful when
pretty printing the results of macro expansions

1 Example top

  • (require '[clojure.pprint :as pp])
    
    (defmacro plus [n1 n2]
      `(+ ~n1 ~n2))
    
    (macroexpand-1 '(plus 3 4))
    ;=> (clojure.core/+ 3 4)
    
    
    (alter-var-root #'pp/*print-suppress-namespaces* (constantly true))
    
    (macroexpand-1 '(plus 3 4))
    ;=> (clojure.core/+ 3 4)
    
    ;; comes into effect only in pprint.
    (pp/pprint (macroexpand-1 '(plus 3 4)))
    ;=> (+ 3 4)
    
Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/pprint/pprint_base.clj:72 top

(def ^:dynamic
 ^{:doc "Don't print namespaces with symbols. This is particularly useful when 
pretty printing the results of macro expansions"
   :added "1.2"}
 *print-suppress-namespaces* nil)
Vars in clojure.pprint/*print-suppress-namespaces*:
Used in 0 other vars

Comments top

No comments for *print-suppress-namespaces*. Log in to add a comment.