From: hayeah
Subject: CLTL2 27.3
Date: 
Message-ID: <1150353592.747584.59260@y41g2000cwy.googlegroups.com>
I am trying to grok the prettying printing machineries.

In CLTL2 27.3, right at the top:

"The characters in the output are represented by hyphens. The
positions of conditional newlines are indicated by digits. The
beginnings and ends of logical blocks are indicated in the figure by
``<'' and ``>'' respectively."

------------------------------------------------------------
Figure 27-1: Example of Logical Blocks, Conditional Newlines, and
Sections

                 <-1---<--<--2---3->--4-->->
                 000000000000000000000000000
                 11 111111111111111111111111
                           22 222
                              333 3333
                        44444444444444 44444
------------------------------------------------------------


I think I understand what logical blocks and sections are, but I don't
see how the hyphens correspond to the 0s, 1s, 2s, 3s, 4s. What does it
mean by "the _positions_ of conditional newlines"?


Also, the ~< directive from hyperspec.

"To a considerable extent, the basic form of the directive ~<...~> is
incompatible with the dynamic control of the arrangement of output by
~W, ~_, ~<...~:>, ~I, and ~:T. As a result, an error is signaled if
any of these directives is nested within ~<...~>. Beyond this, an
error is also signaled if the ~<...~:;...~> form of ~<...~> is used in
the same format string with ~W, ~_, ~<...~:>, ~I, or ~:T."


It forbids nesting of ~<? But an example is given:

(defun pprint-let (list)
  (format t "~:<~W~^ ~:<·@{~:<·@{~W~^ ~_~}~:>~^ ~:_~}~:>~1I~
                ·@{~^ ~_~W~}~:>"
          list))


This is so confusing.