Skip to content

Commit

Permalink
Fix *print-pretty*
Browse files Browse the repository at this point in the history
  • Loading branch information
fonol committed Sep 14, 2023
1 parent 1b5cd1c commit d0b4165
Showing 1 changed file with 17 additions and 21 deletions.
38 changes: 17 additions & 21 deletions pages/002aprint_002dpretty_002a.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,7 @@ <h4 class="subsubheading">Description</h4>
<p>Controls whether the <i><a href="Glossary.html#Lisp-printer">Lisp printer</a></i> calls the <i><a href="Glossary.html#pretty-printer">pretty printer</a></i>.
</p>
<p>If it is <i><a href="Glossary.html#false">false</a></i>,
the <i><a href="Glossary.html#pretty-printer">pretty printer</a></i> is not used and
</p>
<p>a minimum
</p>
<p>of <i><a href="Glossary.html#whitespace">whitespace</a></i>_1
the <i><a href="Glossary.html#pretty-printer">pretty printer</a></i> is not used and a minimum of <i><a href="Glossary.html#whitespace">whitespace</a></i>_1
is output when printing an expression.
</p>
<p>If it is <i><a href="Glossary.html#true">true</a></i>,
Expand All @@ -124,33 +120,33 @@ <h4 class="subsubheading">Examples</h4>
<div class="example">
<pre class="example"><code> (setq *print-pretty* 'nil) ⇒ NIL
(progn (write '(let ((a 1) (b 2) (c 3)) (+ a b c))) nil)
<code class="no-highlight"> |&gt; </code> (LET ((A 1) (B 2) (C 3)) (+ A B C))
|&gt; (LET ((A 1) (B 2) (C 3)) (+ A B C))
⇒ NIL
(let ((*print-pretty* t))
(progn (write '(let ((a 1) (b 2) (c 3)) (+ a b c))) nil))
<code class="no-highlight"> |&gt; </code> (LET ((A 1)
<code class="no-highlight"> |&gt; </code> (B 2)
<code class="no-highlight"> |&gt; </code> (C 3))
<code class="no-highlight"> |&gt; </code> (+ A B C))
|&gt; (LET ((A 1)
|&gt; (B 2)
|&gt; (C 3))
|&gt; (+ A B C))
⇒ NIL
;; Note that the first two expressions printed by this next form
;; differ from the second two only in whether escape characters are printed.
;; In all four cases, extra whitespace is inserted by the pretty printer.
(flet ((test (x)
(let ((*print-pretty* t))
(print x)
(format t "~
(format t "~%~S " x)
(terpri) (princ x) (princ " ")
(format t "~
(test '#'(lambda () (list "a" #<b>’c</b> #'d))))
<code class="no-highlight"> |&gt; </code> #'(LAMBDA ()
<code class="no-highlight"> |&gt; </code> (LIST "a" #<b>’C</b> #'D))
<code class="no-highlight"> |&gt; </code> #'(LAMBDA ()
<code class="no-highlight"> |&gt; </code> (LIST "a" #<b>’C</b> #'D))
<code class="no-highlight"> |&gt; </code> #'(LAMBDA ()
<code class="no-highlight"> |&gt; </code> (LIST a b 'C #'D))
<code class="no-highlight"> |&gt; </code> #'(LAMBDA ()
<code class="no-highlight"> |&gt; </code> (LIST a b 'C #'D))
(format t "~%~A " x))))
(test '#'(lambda () (list "a" #’c #'d))))
|&gt; #'(LAMBDA ()
|&gt; (LIST "a" #’C #'D))
|&gt; #'(LAMBDA ()
|&gt; (LIST "a" #’C #'D))
|&gt; #'(LAMBDA ()
|&gt; (LIST a b 'C #'D))
|&gt; #'(LAMBDA ()
|&gt; (LIST a b 'C #'D))
⇒ NIL
</code>
</pre></div>
Expand Down

0 comments on commit d0b4165

Please sign in to comment.