Skip to content

Commit 110909d

Browse files
committed
Move location
1 parent 39bfdd9 commit 110909d

File tree

2 files changed

+59
-57
lines changed

2 files changed

+59
-57
lines changed

docs/api/pprint.rst

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,65 @@ basilisp.pprint
55
:maxdepth: 2
66
:caption: Contents:
77

8+
Pretty Printing
9+
---------------
10+
11+
Pretty printing built-in data structures is as easy as a call to :lpy:fn:`pprint`.
12+
13+
.. code-block::
14+
15+
(require '[basilisp.pprint :as pprint])
16+
(pprint/pprint (range 30))
17+
18+
The output can be configured using a number of different control variables, which
19+
are expressed as dynamic Vars.
20+
21+
- :lpy:var:`*print-base*`
22+
- :lpy:var:`*print-miser-width*`
23+
- :lpy:var:`*print-pretty*`
24+
- :lpy:var:`*print-pprint-dispatch*`
25+
- :lpy:var:`*print-radix*`
26+
- :lpy:var:`*print-right-margin*`
27+
- :lpy:var:`*print-sort-keys*`
28+
- :lpy:var:`*print-suppress-namespaces*`
29+
30+
You can pretty print the last result from the REPL using the :lpy:fn:`pp` convenience
31+
macro.
32+
33+
As an alternative, the :lpy:fn:`write` API enables a more ergonomic API for
34+
configuring the printer using keyword arguments rather than dynamic Vars.
35+
36+
.. code-block::
37+
38+
(pprint/write (ns-interns 'basilisp.pprint) :sort-keys true)
39+
;; {*current-length* #'basilisp.pprint/*current-length*
40+
;; ...
41+
;; write-out #'basilisp.pprint/write-out}
42+
43+
Custom Pretty Print Dispatch Function
44+
-------------------------------------
45+
46+
TBD
47+
48+
Unimplemented Features
49+
----------------------
50+
51+
The following features from ``clojure.pprint`` are not currently implemented:
52+
53+
- ``:fill`` newlines
54+
- ``code-dispatch`` for printing code
55+
- ``cl-format``
56+
57+
References
58+
----------
59+
60+
- Tom Faulhaber et al.; ``clojure.pprint``
61+
- Oppen, Derek; \"Prettyprinting\"; October 1980
62+
- Waters, Richard; \"XP: A Common Lisp Pretty Printing System\"; March 1989
63+
64+
API
65+
---
66+
867
.. autonamespace:: basilisp.pprint
968
:members:
1069
:undoc-members:

src/basilisp/pprint.lpy

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,4 @@
11
(ns basilisp.pprint
2-
"Basilisp pretty printer
3-
4-
Pretty Printing
5-
---------------
6-
7-
Pretty printing built-in data structures is as easy as a call to :lpy:fn:`pprint`.
8-
9-
.. code-block::
10-
11-
(require '[basilisp.pprint :as pprint])
12-
(pprint/pprint (range 30))
13-
14-
The output can be configured using a number of different control variables, which
15-
are expressed as dynamic Vars.
16-
17-
- :lpy:fn:`*print-base*`
18-
- :lpy:fn:`*print-miser-width*`
19-
- :lpy:fn:`*print-pretty*`
20-
- :lpy:fn:`*print-pprint-dispatch*`
21-
- :lpy:fn:`*print-radix*`
22-
- :lpy:fn:`*print-right-margin*`
23-
- :lpy:fn:`*print-sort-keys*`
24-
- :lpy:fn:`*print-suppress-namespaces*`
25-
26-
You can pretty print the last result from the REPL using the :lpy:fn:`pp` convenience
27-
macro.
28-
29-
As an alternative, the :lpy:fn:`write` API enables a more ergonomic API for
30-
configuring the printer using keyword arguments rather than dynamic Vars.
31-
32-
.. code-block::
33-
34-
(pprint/write (ns-interns 'basilisp.pprint) :sort-keys true)
35-
;; {*current-length* #'basilisp.pprint/*current-length*
36-
;; ...
37-
;; write-out #'basilisp.pprint/write-out}
38-
39-
Custom Pretty Print Dispatch Function
40-
-------------------------------------
41-
42-
TBD
43-
44-
Unimplemented Features
45-
----------------------
46-
47-
The following features from ``clojure.pprint`` are not currently implemented:
48-
49-
- ``:fill`` newlines
50-
- ``code-dispatch`` for printing code
51-
- ``cl-format``
52-
53-
References
54-
----------
55-
56-
- Tom Faulhaber et al.; ``clojure.pprint``
57-
- Oppen, Derek; \"Prettyprinting\"; October 1980
58-
- Waters, Richard; \"XP: A Common Lisp Pretty Printing System\"; March 1989"
592
(:require
603
[basilisp.string :as str]
614
[basilisp.walk :as walk])

0 commit comments

Comments
 (0)