[racket] Pretty printing and extra indentation

From: Asumu Takikawa (asumu at ccs.neu.edu)
Date: Mon Jan 6 15:56:22 EST 2014

On 2014-01-06 15:45:07 -0500, Asumu Takikawa wrote:
> Does anyone know an easy way to add extra indentation to pretty printed
> output using racket/pretty?
>
> For example, suppose I want to add pretty printed output after part of
> an error message like:
>
>   expected: (<pretty printed value>
>              <should be aligned like this>)

Actually, I think I figured out how to do it. Pretty printing to a port
that counts lines automatically handles the initial indentation.

The issue is that I've been using `pretty-format` because the output is
interpolated into format strings later on. If I instead `pretty-print`
to a new output string with line counting enabled (with the initial
text added there), it seems to work.

Cheers,
Asumu

Posted on the users mailing list.