Subject: 25.0.50; pretty printer

From: Leo Liu <[email-masked]>
Date: Tue, 25 Nov 2014 19:04:03 +0800

The very limited pp.el can easily print hundreds of lines for what can
be beautifully put into dozens of lines. This makes the pp'd text hard
to read.

In the following example, pp would print nearly 300 lines while SBCL's
pprint only prints 50ish lines:

([1 ((env nil) (bound nil) (free nil)) ]
 (([1 ((env nil) (bound nil) (free nil)) ]))
 (([1 ((env nil) (bound (f tree)) (free nil)) ]
   (([1 ((env nil) (bound (f)) (free nil)) ])
    ([1 ((env nil) (bound (tree)) (free nil)) ]))
   (([2 ((env (f tree)) (bound nil) (free (f tree))) ]
     (([2 ((env (f tree)) (bound nil) (free (tree))) ]
       (([2 ((env (f tree)) (bound nil) (free nil)) ]
         (([2 ((env (f tree)) (bound nil) (free nil)) ]))
         (([2 ((env (f tree)) (bound nil) (free nil)) ]))))
       (([2 ((env (f tree)) (bound nil) (free (tree))) ]))))
     (([3 ((env (f tree)) (bound nil) (free (f tree))) ]
       (([3 ((env (f tree)) (bound nil) (free nil)) ]))
       (([4 ((env (f tree)) (bound nil) (free (f tree))) ]
         (([4 ((env (f tree)) (bound nil) (free (f))) ]))
         (([4 ((env (f tree)) (bound nil) (free (tree))) ])))))
      ([5 ((env (f tree)) (bound (gs tree1)) (free (f tree))) ]
       (([5 ((env (f tree)) (bound (gs)) (free nil)) ]))
       (([6 ((env (f gs tree)) (bound (tree1)) (free (f gs tree))) ]
         (([6 ((env (f gs tree)) (bound (tree1)) (free nil)) ]))
         (([6 ((env (f gs tree)) (bound nil) (free (f gs tree))) ]
           (([6 ((env (f gs tree)) (bound nil) (free nil)) ]
             (([6 ((env (f gs tree)) (bound nil) (free nil)) ]))
             (([6 ((env (f gs tree)) (bound nil) (free nil)) ]))))
           (([6 ((env (f gs tree)) (bound nil) (free (tree))) ]
             (([6 ((env (f gs tree)) (bound nil) (free nil)) ]
               (([6 ((env (f gs tree)) (bound nil) (free nil)) ]))
               (([6 ((env (f gs tree)) (bound nil) (free nil)) ]))))
             (([6 ((env (f gs tree)) (bound nil) (free (tree))) ])))
            ([7 ((env (f gs tree)) (bound nil) (free (f gs))) ]
             (([7 ((env (f g gs tree)) (bound nil) (free (f g))) ]
               (([7 ((env (f g gs t tree)) (bound nil) (free (f t))) ]
                 (([7 ((env (f g gs t tree)) (bound nil) (free nil)) ]))
                 (([7 ((env (f g gs t tree)) (bound nil) (free (f))) ])
                  ([7 ((env (f g gs t tree)) (bound nil) (free (t))) ]))))
               (([7 ((env (f g gs tree)) (bound (t)) (free (g))) ]
                 (([7 ((env nil) (bound (t)) (free nil)) ]))
                 (([7 ((env (f g gs tree)) (bound nil) (free (g))) ]))))))
             (([8 ((env (f gs tree)) (bound (g)) (free (gs))) ]
               (([8 ((env nil) (bound (g)) (free nil)) ]))
               (([8 ((env (f gs tree)) (bound nil) (free (gs))) ])))))))))
        ([9 ((env (f gs tree tree1)) (bound nil) (free (f tree tree1))) ]
         (([9 ((env (f gs tree tree1)) (bound nil) (free (f))) ]))
         (([9 ((env (f gs tree tree1)) (bound nil) (free (tree tree1))) ]
           (([9 ((env (f gs tree tree1)) (bound nil) (free nil)) ]
             (([9 ((env (f gs tree tree1)) (bound nil) (free nil)) ]))
             (([9 ((env (f gs tree tree1)) (bound nil) (free nil)) ]))))
           (([9 ((env (f gs tree tree1)) (bound nil) (free (tree))) ])
            ([9 ((env (f gs tree tree1)) (bound nil) (free (tree1)))
             ])))))))))))))