racket/collects/unstable/scribblings/pretty.scrbl
Eli Barzilay ac26fe7554 A ton of @scheme*' -> @racket*' and related updates.
Also, updates some of the mzlib files to point at `racket/*' libraries
rather than to `scheme/*' ones.
2011-06-25 04:08:47 -04:00

65 lines
1.9 KiB
Racket

#lang scribble/manual
@(require scribble/eval "utils.rkt" (for-label racket unstable/pretty))
@(define the-eval (make-base-eval))
@(the-eval '(require racket/pretty unstable/pretty))
@title{Pretty-Printing}
@defmodule[unstable/pretty]
This module provides tools for pretty-printing.
@unstable[@author+email["Carl Eastlund" "cce@racket-lang.org"]]
@defproc[(pretty-format/write [x any/c]
[columns
(or/c exact-nonnegative-integer? 'infinity)
(pretty-print-columns)])
string?]{
This procedure behaves like @racket[pretty-format], but it formats values
consistently with @racket[write] instead of @racket[print].
@examples[#:eval the-eval
(struct both [a b] #:transparent)
(pretty-format/write (list (both (list 'a 'b) (list "a" "b"))))
]
}
@defproc[(pretty-format/display [x any/c]
[columns
(or/c exact-nonnegative-integer? 'infinity)
(pretty-print-columns)])
string?]{
This procedure behaves like @racket[pretty-format], but it formats values
consistently with @racket[display] instead of @racket[print].
@examples[#:eval the-eval
(struct both [a b] #:transparent)
(pretty-format/display (list (both (list 'a 'b) (list "a" "b"))))
]
}
@defproc[(pretty-format/print [x any/c]
[columns
(or/c exact-nonnegative-integer? 'infinity)
(pretty-print-columns)])
string?]{
This procedure behaves the same as @racket[pretty-format], but is named
more explicitly to describe how it formats values. It is included for
symmetry with @racket[pretty-format/write] and @racket[pretty-format/display].
@examples[#:eval the-eval
(struct both [a b] #:transparent)
(pretty-format/print (list (both (list 'a 'b) (list "a" "b"))))
]
}
@(close-eval the-eval)