ClojureDocs

Nav

Namespaces

*print-meta*

clojure.core

Available since 1.0
    If set to logical true, when printing an object, its metadata will also
    be printed in a form that can be read back by the reader.
     Defaults to false.
    2 Examples
    user=> (binding [*print-meta* true] 
             (pr (var defmacro)) )
    ;;^{:macro true, :ns #<Namespace clojure.core>, :name defmacro, :arglists ^{:line 424, :column 15} ([name doc-string? attr-map? [params*] body] [name doc-string? attr-map? ^{:line 425, :column 46} ([params*] body) + attr-map?]), :column 1, :added "1.0", :doc "Like defn, but the resulting function name is declared as a\n  macro and will be used as a macro by the compiler when it is\n  called.", :line 419, :file "clojure/core.clj"} #'clojure.core/defmacro
    nil
    
    user=> (binding [*print-meta* true]
             (-> "{:a ^{:b :c} {}}"
                clojure.edn/read-string
                clojure.pprint/pprint))
    {:a ^{:b :c} {}}
    nil
    See Also

    Prints the object(s) to the output stream that is the current value of *out*. Prints the object(s...

    Added by AtKaaZ

    Pretty print object to the optional output writer. If the writer is not provided, print the object ...

    Added by squiter
    2 Notes
      By , created 12.4 years ago

      "printing an object" means via pr not print or println

      By , created 3.8 years ago

      The *print-meta* works for print and pprint after Clojure 1.10.2. Source: https://clojure.atlassian.net/browse/CLJ-1445