previous up next     contents index
Next: Sharing Up: Libraries Previous: Converted Printing

Pretty Printing

  Files: ``pretty.ss'', ``prettyu.ss'', ``prettys.ss'', ``prettyc.ss''
Signature: mzlib:pretty-print tex2html_wrap_inline2054
Unit:  mzlib:pretty-print@

 

(pretty-display v port width graph? struct? depth size-hook print-hook) (procedure)

Same as pretty-print, but v is printed like display instead of like write.

 

(pretty-print v port width graph? struct? depth size-hook print-hook) (procedure)

Pretty-prints the value v using the same printed form as write. All other argument are optional.

 

(pretty-print-columns width) (procedure)

Sets the default width for pretty printing to width and returns #<void>. If no width argument is provided, the current value is returned instead.

 

(pretty-print-depth depth) (procedure)

Sets the default depth for recursive pretty printing to depth and returns #<void>. If no depth argument is provided, the current value is returned instead. A depth of 0 indicates that only simple values are printed; Scheme values within other values (e.g. the elements of a list) are replaced with ``...''.

 

(pretty-print-handler v) (procedure)

Pretty-prints v if v is not #<void> or prints nothing otherwise. Pass this procedure to current-print to install the pretty printer into the read-eval-print loop.

 

(pretty-print-print-hook hook) (procedure)

Sets the print hook for pretty-printing to hook. If hook is not provided, the current hook is returned.

The print hook is applied to a value for printing when the sizing hook (see pretty-print-print-hook) returns an integer size for the value.

The print hook's actual arguments are the value to print and a boolean: #t for printing like display and #f for printing like write.

 

(pretty-print-size-hook hook) (procedure)

Sets the sizing hook for pretty-printing to hook. If hook is not provided, the current hook is returned.

The sizing hook is applied to each value to be printed. If the hook returns #f, then printing is handled internally by the pretty-printer. Otherwise, the value should be an integer specifying the length of the printed value in characters; the print hook will be called to actually print the value (see pretty-print-print-hook.

The sizing hook's actual arguments are the value to print and a boolean: #t for printing like display and #f for printing like write. The sizing hook may be applied to the same value mulitple times during pretty-printing.


previous up next     contents index
Next: Sharing Up: Libraries Previous: Converted Printing

PLT