[racket-dev] scribble interaction

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Sun Aug 28 12:05:51 EDT 2011

Shouldn't the pretty-print version be the default one? How often would I want to write documentation that doesn't pretty print? 

-- Matthias



On Aug 27, 2011, at 4:07 PM, Matthew Flatt wrote:

> At Sat, 27 Aug 2011 13:22:12 -0400, Matthias Felleisen wrote:
>> 
>> When you run this program, you don't get the pretty printing you get in plain 
>> Racket or in Dr. Why? 
> 
> The default evaluator for `interaction' is analogous to
> 
> racket -l racket/base -i
> 
> where `pretty-print' isn't installed as the printer.
> 
> The example below illustrates how to install pretty printing into an
> `interaction' sandbox.
> 
> ----------------------------------------
> #lang scribble/manual
> 
> @(require scribble/eval)
> 
> @(define ex-eval (make-base-eval))
> @(interaction-eval
>  #:eval ex-eval
>  (begin
>    (require racket/pretty)
>    (current-print pretty-print-handler)))
> 
> @interaction[ 
> #:eval ex-eval
> (define (f x)
>   `(,(build-list x add1)
>     ,(build-list x add1)))
> (f 20)
> ]
> 
> @(close-eval ex-eval)
> 




Posted on the dev mailing list.