Mercurial > lasercutter
diff src/clojure/pprint.clj @ 10:ef7dbbd6452c
added clojure source goodness
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sat, 21 Aug 2010 06:25:44 -0400 |
parents | |
children |
line wrap: on
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/clojure/pprint.clj Sat Aug 21 06:25:44 2010 -0400 1.3 @@ -0,0 +1,48 @@ 1.4 +;;; pprint.clj -- Pretty printer and Common Lisp compatible format function (cl-format) for Clojure 1.5 + 1.6 +; Copyright (c) Rich Hickey. All rights reserved. 1.7 +; The use and distribution terms for this software are covered by the 1.8 +; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 1.9 +; which can be found in the file epl-v10.html at the root of this distribution. 1.10 +; By using this software in any fashion, you are agreeing to be bound by 1.11 +; the terms of this license. 1.12 +; You must not remove this notice, or any other, from this software. 1.13 + 1.14 +;; Author: Tom Faulhaber 1.15 +;; April 3, 2009 1.16 + 1.17 +(ns 1.18 + ^{:author "Tom Faulhaber", 1.19 + :doc "A Pretty Printer for Clojure 1.20 + 1.21 +clojure.pprint implements a flexible system for printing structured data 1.22 +in a pleasing, easy-to-understand format. Basic use of the pretty printer is 1.23 +simple, just call pprint instead of println. More advanced users can use 1.24 +the building blocks provided to create custom output formats. 1.25 + 1.26 +Out of the box, pprint supports a simple structured format for basic data 1.27 +and a specialized format for Clojure source code. More advanced formats, 1.28 +including formats that don't look like Clojure data at all like XML and 1.29 +JSON, can be rendered by creating custom dispatch functions. 1.30 + 1.31 +In addition to the pprint function, this module contains cl-format, a text 1.32 +formatting function which is fully compatible with the format function in 1.33 +Common Lisp. Because pretty printing directives are directly integrated with 1.34 +cl-format, it supports very concise custom dispatch. It also provides 1.35 +a more powerful alternative to Clojure's standard format function. 1.36 + 1.37 +See documentation for pprint and cl-format for more information or 1.38 +complete documentation on the the clojure web site on github.", 1.39 + :added "1.2"} 1.40 + clojure.pprint 1.41 + (:refer-clojure :exclude (deftype))) 1.42 + 1.43 + 1.44 +(load "pprint/utilities") 1.45 +(load "pprint/column_writer") 1.46 +(load "pprint/pretty_writer") 1.47 +(load "pprint/pprint_base") 1.48 +(load "pprint/cl_format") 1.49 +(load "pprint/dispatch") 1.50 + 1.51 +nil