[racket] pretty-print example?

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Mon Nov 8 09:07:05 EST 2010

At Thu, 4 Nov 2010 10:11:02 -0400, "Altenburg, Robert" wrote:
> I have an application where I'd like to limit the
> width of the printed results.  It seems like
> pretty-print should accomplish that, but when
> I tried the code below it's not adding newlines.
> 
> (require racket/pretty)
> (pretty-print-columns 25)
> (pretty-display "A123456789 123456789 123456789 123456789")
> 
> Does anyone happen to have a working example?

The `pretty-print' and `prety-display' functions do not break apart
strings. They only know how to introduce newlines for compound data
structures such as lists.

 > (require racket/pretty)
 > (pretty-print-columns 25)
 > (pretty-display (list "A123456789" "123456789" "123456789" "123456789"))
 (A123456789
  123456789
  123456789
  123456789)



Posted on the users mailing list.