liveBook · Manning

*print-suppress-namespaces*

As explained in Clojure: The Essential Reference

*print-suppress-namespaces* is a Clojure dynamic variable controlling whether namespace qualifications are omitted when symbols are printed.

*print-suppress-namespaces* is a dynamic printing variable that controls whether fully qualified symbols retain their namespace prefixes. It defaults to false, so namespaces normally appear. section 23.20

Suppressing symbol namespaces

(require '[clojure.pprint :as pprint]) (pprint/pprint '{num/val 1 num/name "one"}) ;; {num/val 1, num/name "one"} (binding [pprint/*print-suppress-namespaces* true] (pprint/pprint '{num/val 1 num/name "one"})) ;; {val 1, name "one"} (binding [pprint/*print-suppress-namespaces* true] (pprint {:num/val 1 :num/name "one"})) ;; {:num/val 1, :num/name "one"}

The setting affects symbols, not keyword namespace qualifiers. A local binding is useful when readable output matters without changing the process-wide default. section 23.20

Readable macroexpansion

Syntax-quoting automatically namespaces symbols, which can make macroexpanded forms noisy. Bind the variable alongside code dispatch to display the expansion without those automatic qualifications. section 23.20

How Clojure: The Essential Reference covers it

How deep it goes
Defines the default and demonstrates binding behavior, symbol-only scope, and macroexpansion output without descending into printer internals.
Examples
Uses qualified symbol maps, namespaced keyword maps, and a macroexpanded definition printed with code dispatch.
What you can do after
Apply it via binding to print symbols without namespace prefixes while preserving namespaced keywords.
How it connects
Connects namespace qualification, symbols, keywords, syntax-quoting, macro expansion, and pretty printing.

This explainer was generated by Manning's knowledge graph from the text of Clojure: The Essential Reference. The section links point to the parts of the book it draws on.