From a6dea9b85c7ed31aab70e072c65564b7be633cf0 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Sun, 26 Sep 2010 16:43:09 -0500 Subject: [PATCH] removed current-pretty-printer (it was never released and it is superceded by pretty-print-parameters). --- collects/redex/gui.rkt | 6 +----- collects/redex/private/size-snip.rkt | 3 --- collects/redex/private/stepper.rkt | 4 ++-- collects/redex/private/traces.rkt | 4 ++-- collects/redex/redex.scrbl | 26 ++++++++++++-------------- 5 files changed, 17 insertions(+), 26 deletions(-) diff --git a/collects/redex/gui.rkt b/collects/redex/gui.rkt index 8b54bb057a..93b18b66a4 100644 --- a/collects/redex/gui.rkt +++ b/collects/redex/gui.rkt @@ -103,8 +103,4 @@ [default-pretty-printer (-> any/c output-port? exact-nonnegative-integer? (is-a?/c text%) void?)] - [pretty-print-parameters (parameter/c (-> (-> any) any))] - [current-pretty-printer - (parameter/c - (-> any/c output-port? exact-nonnegative-integer? (is-a?/c text%) - void?))]) + [pretty-print-parameters (parameter/c (-> (-> any) any))]) diff --git a/collects/redex/private/size-snip.rkt b/collects/redex/private/size-snip.rkt index 6c2cc56334..49324b7faf 100644 --- a/collects/redex/private/size-snip.rkt +++ b/collects/redex/private/size-snip.rkt @@ -9,7 +9,6 @@ size-editor-snip% size-text% default-pretty-printer - current-pretty-printer pretty-print-parameters initial-char-width resizing-pasteboard-mixin @@ -44,8 +43,6 @@ (λ () (pretty-print v port))))) -(define current-pretty-printer (make-parameter default-pretty-printer)) - (define reflowing-snip<%> (interface () reflow-program)) diff --git a/collects/redex/private/stepper.rkt b/collects/redex/private/stepper.rkt index 217ec04a2d..9b7af08c28 100644 --- a/collects/redex/private/stepper.rkt +++ b/collects/redex/private/stepper.rkt @@ -50,10 +50,10 @@ todo: (define updown-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)) - (define (stepper/seed red seed [pp (current-pretty-printer)]) + (define (stepper/seed red seed [pp default-pretty-printer]) (define term (car seed)) ;; all-nodes-ht : hash[sexp -o> (is-a/c node%)] (define all-nodes-ht (make-hash)) diff --git a/collects/redex/private/traces.rkt b/collects/redex/private/traces.rkt index d3e51d53f1..a6ce716691 100644 --- a/collects/redex/private/traces.rkt +++ b/collects/redex/private/traces.rkt @@ -130,7 +130,7 @@ (define (traces/ps reductions pre-exprs filename #:multiple? [multiple? #f] #:pred [pred (λ (x) #t)] - #:pp [pp (current-pretty-printer)] + #:pp [pp default-pretty-printer] #:racket-colors? [racket-colors? #t] #:scheme-colors? [scheme-colors? racket-colors?] #:colors [colors '()] @@ -241,7 +241,7 @@ (define (traces reductions pre-exprs #:multiple? [multiple? #f] #:pred [pred (λ (x) #t)] - #:pp [pp (current-pretty-printer)] + #:pp [pp default-pretty-printer] #:colors [colors '()] #:racket-colors? [racket-colors? #t] #:scheme-colors? [scheme-colors? racket-colors?] diff --git a/collects/redex/redex.scrbl b/collects/redex/redex.scrbl index 99cc052836..009b59232d 100644 --- a/collects/redex/redex.scrbl +++ b/collects/redex/redex.scrbl @@ -1458,7 +1458,7 @@ exploring reduction sequences. [#:pp pp (or/c (any -> string) (any output-port number (is-a?/c text%) -> void)) - (current-pretty-printer)] + default-pretty-printer] [#:colors colors (listof (cons/c string? @@ -1577,7 +1577,7 @@ inserted into the editor by this library have a [#:pp pp (or/c (any -> string) (any output-port number (is-a?/c text%) -> void)) - (current-pretty-printer)] + default-pretty-printer] [#:colors colors (listof (cons/c string? @@ -1607,7 +1607,7 @@ just before the PostScript is created with the graph pasteboard. [t any/c] [pp (or/c (any -> string) (any output-port number (is-a?/c text%) -> void)) - (current-pretty-printer)]) + default-pretty-printer]) void?]{ 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. 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?] [seed (cons/c any/c (listof any/c))] [pp (or/c (any -> string) (any output-port number (is-a?/c text%) -> void)) - (current-pretty-printer)]) + default-pretty-printer]) void?]{ 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?]{ This is the default value of @racket[pp] used by @racket[traces] and