removed current-pretty-printer (it was never released and it is

superceded by pretty-print-parameters).
This commit is contained in:
Robby Findler 2010-09-26 16:43:09 -05:00
parent f87aa7ec61
commit a6dea9b85c
5 changed files with 17 additions and 26 deletions

View File

@ -103,8 +103,4 @@
[default-pretty-printer [default-pretty-printer
(-> any/c output-port? exact-nonnegative-integer? (is-a?/c text%) (-> any/c output-port? exact-nonnegative-integer? (is-a?/c text%)
void?)] void?)]
[pretty-print-parameters (parameter/c (-> (-> any) any))] [pretty-print-parameters (parameter/c (-> (-> any) any))])
[current-pretty-printer
(parameter/c
(-> any/c output-port? exact-nonnegative-integer? (is-a?/c text%)
void?))])

View File

@ -9,7 +9,6 @@
size-editor-snip% size-editor-snip%
size-text% size-text%
default-pretty-printer default-pretty-printer
current-pretty-printer
pretty-print-parameters pretty-print-parameters
initial-char-width initial-char-width
resizing-pasteboard-mixin resizing-pasteboard-mixin
@ -44,8 +43,6 @@
(λ () (λ ()
(pretty-print v port))))) (pretty-print v port)))))
(define current-pretty-printer (make-parameter default-pretty-printer))
(define reflowing-snip<%> (define reflowing-snip<%>
(interface () (interface ()
reflow-program)) reflow-program))

View File

@ -50,10 +50,10 @@ todo:
(define updown-label (pick-label "" "^")) (define updown-label (pick-label "" "^"))
(define back-label (pick-label "" "<-")) (define back-label (pick-label "" "<-"))
(define (stepper red term [pp (current-pretty-printer)]) (define (stepper red term [pp default-pretty-printer])
(stepper/seed red (list term) pp)) (stepper/seed red (list term) pp))
(define (stepper/seed red seed [pp (current-pretty-printer)]) (define (stepper/seed red seed [pp default-pretty-printer])
(define term (car seed)) (define term (car seed))
;; all-nodes-ht : hash[sexp -o> (is-a/c node%)] ;; all-nodes-ht : hash[sexp -o> (is-a/c node%)]
(define all-nodes-ht (make-hash)) (define all-nodes-ht (make-hash))

View File

@ -130,7 +130,7 @@
(define (traces/ps reductions pre-exprs filename (define (traces/ps reductions pre-exprs filename
#:multiple? [multiple? #f] #:multiple? [multiple? #f]
#:pred [pred (λ (x) #t)] #:pred [pred (λ (x) #t)]
#:pp [pp (current-pretty-printer)] #:pp [pp default-pretty-printer]
#:racket-colors? [racket-colors? #t] #:racket-colors? [racket-colors? #t]
#:scheme-colors? [scheme-colors? racket-colors?] #:scheme-colors? [scheme-colors? racket-colors?]
#:colors [colors '()] #:colors [colors '()]
@ -241,7 +241,7 @@
(define (traces reductions pre-exprs (define (traces reductions pre-exprs
#:multiple? [multiple? #f] #:multiple? [multiple? #f]
#:pred [pred (λ (x) #t)] #:pred [pred (λ (x) #t)]
#:pp [pp (current-pretty-printer)] #:pp [pp default-pretty-printer]
#:colors [colors '()] #:colors [colors '()]
#:racket-colors? [racket-colors? #t] #:racket-colors? [racket-colors? #t]
#:scheme-colors? [scheme-colors? racket-colors?] #:scheme-colors? [scheme-colors? racket-colors?]

View File

@ -1458,7 +1458,7 @@ exploring reduction sequences.
[#:pp pp [#:pp pp
(or/c (any -> string) (or/c (any -> string)
(any output-port number (is-a?/c text%) -> void)) (any output-port number (is-a?/c text%) -> void))
(current-pretty-printer)] default-pretty-printer]
[#:colors colors [#:colors colors
(listof (listof
(cons/c string? (cons/c string?
@ -1577,7 +1577,7 @@ inserted into the editor by this library have a
[#:pp pp [#:pp pp
(or/c (any -> string) (or/c (any -> string)
(any output-port number (is-a?/c text%) -> void)) (any output-port number (is-a?/c text%) -> void))
(current-pretty-printer)] default-pretty-printer]
[#:colors colors [#:colors colors
(listof (listof
(cons/c string? (cons/c string?
@ -1607,7 +1607,7 @@ just before the PostScript is created with the graph pasteboard.
[t any/c] [t any/c]
[pp (or/c (any -> string) [pp (or/c (any -> string)
(any output-port number (is-a?/c text%) -> void)) (any output-port number (is-a?/c text%) -> void))
(current-pretty-printer)]) default-pretty-printer])
void?]{ void?]{
This function opens a stepper window for exploring the This function opens a stepper window for exploring the
@ -1615,14 +1615,21 @@ behavior of its third argument in the reduction system
described by its first two arguments. described by its first two arguments.
The @racket[pp] argument is the same as to the The @racket[pp] argument is the same as to the
@racket[traces] functions (above). @racket[traces] functions (above) but is here for
backwards compatibility only and
should not be changed for most uses, but instead adjusted with
@racket[pretty-print-parameters]. Specifically, the
highlighting shown in the stepper window can be wrong if
@racket[default-pretty-printer] does not print sufficiently similarly
to how @racket[pretty-print] prints (when adjusted by
@racket[pretty-print-parameters]'s behavior, of course).
} }
@defproc[(stepper/seed [reductions reduction-relation?] @defproc[(stepper/seed [reductions reduction-relation?]
[seed (cons/c any/c (listof any/c))] [seed (cons/c any/c (listof any/c))]
[pp (or/c (any -> string) [pp (or/c (any -> string)
(any output-port number (is-a?/c text%) -> void)) (any output-port number (is-a?/c text%) -> void))
(current-pretty-printer)]) default-pretty-printer])
void?]{ void?]{
Like @racket[stepper], this function opens a stepper window, but it Like @racket[stepper], this function opens a stepper window, but it
@ -1759,15 +1766,6 @@ color used to draw the label on the edge.
} }
@defparam[current-pretty-printer pp (-> any/c
output-port?
exact-nonnegative-integer?
(is-a?/c text%)
void?)]{
A parameter that is used by the graphics tools to render
expressions. Defaults to @racket[default-pretty-printer].
}
@defproc[(default-pretty-printer [v any/c] [port output-port?] [width exact-nonnegative-integer?] [text (is-a?/c text%)]) void?]{ @defproc[(default-pretty-printer [v any/c] [port output-port?] [width exact-nonnegative-integer?] [text (is-a?/c text%)]) void?]{
This is the default value of @racket[pp] used by @racket[traces] and This is the default value of @racket[pp] used by @racket[traces] and