set-pprint-dispatch

clojure.contrib.pprint

  • (set-pprint-dispatch function)
Set the pretty print dispatch function to a function matching (fn [obj] ...)
where obj is the object to pretty print. That function will be called with *out* set
to a pretty printing writer to which it should do its printing.

For example functions, see *simple-dispatch* and *code-dispatch* in
clojure.contrib.pprint.dispatch.clj.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/pprint/pprint_base.clj:246 top

(defn set-pprint-dispatch  
  "Set the pretty print dispatch function to a function matching (fn [obj] ...)
where obj is the object to pretty print. That function will be called with *out* set
to a pretty printing writer to which it should do its printing.

For example functions, see *simple-dispatch* and *code-dispatch* in 
clojure.contrib.pprint.dispatch.clj."
  [function]
  (let [old-meta (meta #'*print-pprint-dispatch*)]
    (alter-var-root #'*print-pprint-dispatch* (constantly function))
    (alter-meta! #'*print-pprint-dispatch* (constantly old-meta)))
  nil)
Vars in clojure.contrib.pprint/set-pprint-dispatch: *print-pprint-dispatch* alter-meta! alter-var-root constantly defn let
Used in 1 other vars set-pprint-dispatch

Comments top

No comments for set-pprint-dispatch. Log in to add a comment.