Abstracted out a function to set printing parameters for the

macro debugger and the syntax browser.

Set all printing parameters to their defaults (as observed
from both mzscheme and drscheme).

svn: r16254
This commit is contained in:
Carl Eastlund 2009-10-06 21:33:54 +00:00
parent 4b9223e6e7
commit cf5c0a1b08
3 changed files with 17 additions and 20 deletions

View File

@ -107,16 +107,8 @@
(parameterize
([pretty-print-size-hook pp-size-hook]
[pretty-print-print-hook pp-print-hook]
[pretty-print-current-style-table (pp-extend-style-table)]
;; Printing parameters (mzscheme manual 7.9.1.4)
[print-unreadable #t]
[print-graph #f]
[print-struct #f]
[print-box #t]
[print-vector-length #t]
[print-hash-table #f]
[print-honu #f])
(pretty-print datum)))
[pretty-print-current-style-table (pp-extend-style-table)])
(pretty-print/defaults datum)))
(define (->show-function show)
(cond [(procedure? show)

View File

@ -1,6 +1,7 @@
#lang scheme/base
(require scheme/class
scheme/pretty
macro-debugger/util/class-iop
syntax/stx
"interfaces.ss")
@ -20,6 +21,18 @@
;; If they were always wrapped, the pretty-printer would screw up
;; list printing (I think).
(define (pretty-print/defaults datum [port (current-output-port)])
(parameterize
(;; Printing parameters (defaults from MzScheme and DrScheme 4.2.2.2)
[print-unreadable #t]
[print-graph #f]
[print-struct #t]
[print-box #t]
[print-vector-length #f]
[print-hash-table #t]
[print-honu #f])
(pretty-print datum port)))
(define-struct syntax-dummy (val))
;; A SuffixOption is one of

View File

@ -52,16 +52,8 @@
[pretty-print-size-hook pp-size-hook]
[pretty-print-print-hook pp-print-hook]
[pretty-print-current-style-table (pp-extend-style-table identifier-list)]
[pretty-print-columns columns]
;; Printing parameters (mzscheme manual 7.9.1.4)
[print-unreadable #t]
[print-graph #f]
[print-struct #t]
[print-box #t]
[print-vector-length #t]
[print-hash-table #f]
[print-honu #f])
(pretty-print datum port)
[pretty-print-columns columns])
(pretty-print/defaults datum port)
(new range%
(range-builder range-builder)
(identifier-list identifier-list))))