[plt-scheme] Re: pretty-print?

From: dillogimp at gmail.com (dillogimp at gmail.com)
Date: Thu Apr 19 16:53:53 EDT 2007


On Apr 20, 3:56 am, John Clements <cleme... at brinckerhoff.org> wrote:
> On Apr 19, 2007, at 11:01 AM, dillog... at gmail.com wrote:
>
> > Welcome to MzScheme version 360, Copyright (c) 2004-2006 PLT Scheme
> > Inc.
>
> > (require (lib "pretty.ss"))
> > (define sq (lambda (x) (* x x))) (sq 5)mzscheme
> > (pretty-print sq)
> > #<procedure:sq>
>
> > This is not pretty...
>
> Read the docs for pretty-print:
>
> (pretty-print v [port])      PROCEDURE
>
> Pretty-prints the value v using the same printed form as write, but
> with newlines and whitespace inserted to avoid lines longer than
> (pretty-print-columns), as controlled by (pretty-print-current-style-
> table). The printed form ends in a newline unless the pretty-print-
> columns parameter is set to 'infinity.
>
> ...
>
> That is, the goal of pretty-print is to insert newlines and tabbing
> in a printed representation.  Not to conform to an aesthetic standard...
>
> More generally, you may be curious to know whether it's possible to
> map a closure (that is to say, the result of evaluating a procedure
> declaration) to a string in a "more one-to-one" way.  I claim that
> there are multiple threads on this mailing list that discuss this
> topic.  Let me know if you have trouble locating them.

Can someone just give the steps that I can pp like mit-scheme pp?


>
> John Clements
>
>  smime.p7s
> 2KDownload
>
> _________________________________________________
>   For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme



Posted on the users mailing list.