From 17090fca4f19298f01d03fea419edb20f315d040 Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Sun, 6 May 2012 12:06:00 -0400 Subject: [PATCH] A bunch of `fprintf' -> `eprintf' conversions (and a few related things). --- collects/2htdp/private/image-more.rkt | 4 ++-- collects/compiler/commands/ctool.rkt | 3 +-- collects/compiler/demodularizer/util.rkt | 3 --- collects/compiler/embed-unit.rkt | 20 ++++++++-------- collects/compiler/main.rkt | 3 +-- collects/compiler/private/macfw.rkt | 7 +++--- collects/compiler/private/xform.rkt | 15 +++++------- collects/db/private/generic/common.rkt | 2 +- collects/deinprogramm/deinprogramm-langs.rkt | 4 ++-- .../deinprogramm/signature/signature-unit.rkt | 4 ++-- collects/drracket/drracket.rkt | 2 +- collects/drracket/private/debug.rkt | 6 ++--- collects/drracket/private/eval-helpers.rkt | 3 +-- .../private/language-configuration.rkt | 12 ++++------ .../private/module-language-tools.rkt | 10 ++++---- collects/drracket/private/module-language.rkt | 2 +- collects/drracket/private/rep.rkt | 3 +-- collects/ffi/examples/use-tcl.rkt | 13 ++++------ collects/framework/splash.rkt | 7 +++--- collects/frtime/core/frp.rkt | 4 +--- collects/frtime/lang-core.rkt | 6 ++--- collects/frtime/lang-ext.rkt | 4 ++-- collects/games/chat-noir/chat-noir-unit.rkt | 3 +-- collects/games/gcalc/gcalc.rkt | 3 --- .../raw-problems/build-hattori.rkt | 21 +++++++--------- .../raw-problems/build-rows-cols.rkt | 9 ++++--- .../raw-problems/build-solution-sets.rkt | 8 +++---- collects/games/paint-by-numbers/solve.rkt | 2 +- collects/games/parcheesi/test.rkt | 18 ++++++-------- collects/games/pousse/counter.rkt | 3 +-- collects/games/pousse/robot.rkt | 16 ++++++------- collects/gui-debugger/debug-tool.rkt | 2 +- collects/handin-server/private/config.rkt | 4 +--- collects/handin-server/private/logger.rkt | 4 ++-- collects/lang/htdp-langs.rkt | 4 ++-- .../macro-debugger/model/deriv-parser.rkt | 4 +--- .../model/reductions-config.rkt | 6 ++--- .../model/reductions-engine.rkt | 10 +++----- collects/macro-debugger/model/reductions.rkt | 2 +- collects/meta/checker.rkt | 3 +-- collects/meta/drdr/plt-build.rkt | 2 +- collects/meta/drdr/replay.rkt | 10 ++++---- .../aligned-pasteboard/tests/test-macro.rkt | 2 +- collects/mzlib/deflate.rkt | 2 +- collects/mzlib/restart.rkt | 4 ++-- collects/mzlib/zip.rkt | 6 ++--- collects/net/qp.rkt | 5 +--- collects/parser-tools/private-yacc/table.rkt | 12 ++++------ collects/parser-tools/yacc.rkt | 3 +-- collects/planet/private/cmdline-tool.rkt | 2 +- collects/planet/util.rkt | 8 +++---- collects/plot/common/deprecation-warning.rkt | 6 ++--- collects/profile/main.rkt | 3 +-- collects/racket/enter.rkt | 3 +-- collects/raco/all-tools.rkt | 11 ++++----- collects/raco/raco.rkt | 16 ++++++------- collects/redex/examples/beginner.rkt | 14 +++++------ collects/redex/examples/r6rs/r6rs-tests.rkt | 5 ++-- collects/redex/examples/r6rs/test.rkt | 4 ++-- collects/redex/tests/test-util.rkt | 5 ++-- collects/scribble/core.rkt | 3 +-- collects/scribble/html-render.rkt | 3 +-- collects/scribble/latex-render.rkt | 3 +-- collects/scribble/private/manual-bind.rkt | 3 +-- collects/setup/scribble.rkt | 2 +- collects/setup/setup-unit.rkt | 5 ++-- collects/setup/unixstyle-install.rkt | 3 +-- collects/setup/winvers-change.rkt | 6 ++--- collects/setup/xref.rkt | 3 +-- collects/sirmail/spell.rkt | 2 +- collects/slatex/pdf-slatex-launcher.rkt | 2 +- collects/slideshow/cmdline.rkt | 2 +- collects/stepper/private/annotate.rkt | 2 +- .../string-constants/private/only-once.rkt | 3 +-- collects/tests/compiler/zo-test.rkt | 4 ++-- collects/tests/drracket/io.rkt | 8 +++---- collects/tests/drracket/language-test.rkt | 21 ++++++---------- .../drracket/no-write-and-frame-leak.rkt | 8 +++---- .../drracket/private/drracket-test-util.rkt | 2 +- .../private/module-lang-test-utils.rkt | 9 +++---- .../tests/drracket/private/randomly-click.rkt | 14 ++++------- collects/tests/drracket/private/repl-test.rkt | 24 +++++++------------ .../drracket/private/run-example-tool.rkt | 3 +-- .../drracket/syncheck-eval-compile-time.rkt | 3 +-- collects/tests/drracket/syncheck-test.rkt | 17 +++++-------- .../tests/drracket/teaching-lang-coverage.rkt | 8 +++---- .../drracket/teaching-lang-save-file.rkt | 4 ++-- .../teaching-lang-sharing-modules.rkt | 3 +-- collects/tests/drracket/test-engine-test.rkt | 5 ++-- collects/tests/framework/main.rkt | 8 +++---- .../gracket/image-snip-unmarshalling.rkt | 5 ++-- collects/tests/gracket/item.rkt | 9 ++++--- collects/tests/gracket/wxme.rkt | 5 ++-- collects/tests/stepper/test-engine.rkt | 4 ++-- collects/texpict/private/mrpict-extra.rkt | 3 +-- collects/typed-racket/types/printer.rkt | 2 +- .../web-server/dispatchers/dispatch-files.rkt | 6 ++--- src/worksp/gc2/make.rkt | 11 ++++----- 98 files changed, 243 insertions(+), 367 deletions(-) diff --git a/collects/2htdp/private/image-more.rkt b/collects/2htdp/private/image-more.rkt index 5f8a7d1a09..1645c94dbe 100644 --- a/collects/2htdp/private/image-more.rkt +++ b/collects/2htdp/private/image-more.rkt @@ -651,9 +651,9 @@ (ibitmap-angle bitmap))]) (values l t r b)))] [else - (fprintf (current-error-port) "using bad bounding box for ~s\n" atomic-shape) + (eprintf "using bad bounding box for ~s\n" atomic-shape) (values 0 0 100 100)])) - + (define (rotated-rectangular-bounding-box w h θ) (let*-values ([(ax ay) (rotate-xy (- (/ w 2)) (- (/ h 2)) θ)] [(bx by) (rotate-xy (- (/ w 2)) (/ h 2) θ)] diff --git a/collects/compiler/commands/ctool.rkt b/collects/compiler/commands/ctool.rkt index 1e962fae63..9d50fbed31 100644 --- a/collects/compiler/commands/ctool.rkt +++ b/collects/compiler/commands/ctool.rkt @@ -225,8 +225,7 @@ (begin (link-variant 'cgc) (compile-variant 'cgc))) (define (compiler-warning) - (fprintf (current-error-port) - "Warning: ~a\n ~a\n" + (eprintf "Warning: ~a\n ~a\n" "compilation to C is usually less effective for performance" "than relying on the bytecode just-in-time compiler.")) diff --git a/collects/compiler/demodularizer/util.rkt b/collects/compiler/demodularizer/util.rkt index 717dee8994..1865bc133f 100644 --- a/collects/compiler/demodularizer/util.rkt +++ b/collects/compiler/demodularizer/util.rkt @@ -9,9 +9,6 @@ (define total-stxs (length (prefix-stxs pre))) (+ syntax-start total-stxs (if (zero? total-stxs) 0 1))) -(define (eprintf . args) - (apply fprintf (current-error-port) args)) - (struct nothing ()) (define-syntax-rule (eprintf* . args) (void)) diff --git a/collects/compiler/embed-unit.rkt b/collects/compiler/embed-unit.rkt index 7fa15d0e06..b2a4731dba 100644 --- a/collects/compiler/embed-unit.rkt +++ b/collects/compiler/embed-unit.rkt @@ -364,7 +364,7 @@ [else ;; First use of the module. Get code and then get code for imports. (when verbose? - (fprintf (current-error-port) "Getting ~s as ~s\n" module-path filename)) + (eprintf "Getting ~s as ~s\n" module-path filename)) (let* ([submod-path (if (pair? filename) (cddr filename) null)] @@ -412,7 +412,7 @@ (cond [(extension? code) (when verbose? - (fprintf (current-error-port) " using extension: ~s\n" (extension-path code))) + (eprintf " using extension: ~s\n" (extension-path code))) (set-box! codes (cons (make-mod filename module-path code name prefix full-name @@ -504,7 +504,7 @@ (append sub-paths normalized-extra-paths)) (when verbose? (unless (null? runtime-paths) - (fprintf (current-error-port) "Runtime paths for ~s: ~s\n" + (eprintf "Runtime paths for ~s: ~s\n" filename runtime-paths))) (if (and collects-dest @@ -934,7 +934,7 @@ (quote ,(map (lambda (m) (let ([p (extension-path (mod-code m))]) (when verbose? - (fprintf (current-error-port) "Recording extension at ~s\n" p)) + (eprintf "Recording extension at ~s\n" p)) (list (path->bytes p) (mod-full-name m) ;; The program name isn't used. It just helps ensures that @@ -1040,7 +1040,7 @@ (unless (or (extension? (mod-code nc)) (eq? nc table-mod)) (when verbose? - (fprintf (current-error-port) "Writing module from ~s\n" (mod-file nc))) + (eprintf "Writing module from ~s\n" (mod-file nc))) (write (compile-using-kernel `(current-module-declare-name (make-resolved-module-path @@ -1067,7 +1067,7 @@ outp)))) (for-each (lambda (f) (when verbose? - (fprintf (current-error-port) "Copying from ~s\n" f)) + (eprintf "Copying from ~s\n" f)) (call-with-input-file* f (lambda (i) (copy-port i outp)))) @@ -1173,7 +1173,7 @@ (check-collects-path 'create-embedding-executable collects-path collects-path-bytes) (let ([exe (find-exe mred? variant)]) (when verbose? - (fprintf (current-error-port) "Copying to ~s\n" dest)) + (eprintf "Copying to ~s\n" dest)) (let-values ([(dest-exe orig-exe osx?) (cond [(and mred? (eq? 'macosx (system-type))) @@ -1347,12 +1347,12 @@ #:exists 'append)) (values start decl-end (file-size dest-exe) #f)))))]) (when verbose? - (fprintf (current-error-port) "Setting command line\n")) - (let () + (eprintf "Setting command line\n")) + (let () (let ([full-cmdline (make-full-cmdline start decl-end end)]) (when collects-path-bytes (when verbose? - (fprintf (current-error-port) "Setting collection path\n")) + (eprintf "Setting collection path\n")) (set-collects-path dest-exe collects-path-bytes)) (cond [(and use-starter-info? osx?) diff --git a/collects/compiler/main.rkt b/collects/compiler/main.rkt index 77ac554b20..826d291139 100644 --- a/collects/compiler/main.rkt +++ b/collects/compiler/main.rkt @@ -376,8 +376,7 @@ (begin (link-variant 'cgc) (compile-variant 'cgc))) (define (compiler-warning) - (fprintf (current-error-port) - "Warning: ~a\n ~a\n" + (eprintf "Warning: ~a\n ~a\n" "compilation to C is usually less effective for performance" "than relying on the bytecode just-in-time compiler.")) diff --git a/collects/compiler/private/macfw.rkt b/collects/compiler/private/macfw.rkt index 2f9ef2b71e..374fd19527 100644 --- a/collects/compiler/private/macfw.rkt +++ b/collects/compiler/private/macfw.rkt @@ -44,8 +44,7 @@ (if v (bytes->string/utf-8 v) (begin - (fprintf (current-error-port) - "warning: cannot find existing link for ~a in ~a\n" - p dest) - #f))))) + (eprintf "warning: cannot find existing link for ~a in ~a\n" + p dest) + #f))))) diff --git a/collects/compiler/private/xform.rkt b/collects/compiler/private/xform.rkt index 8a32453d5a..86059f77b3 100644 --- a/collects/compiler/private/xform.rkt +++ b/collects/compiler/private/xform.rkt @@ -459,7 +459,7 @@ (let loop () (let ([l (read-bytes-line (list-ref proc 3) 'any)]) (unless (eof-object? l) - (fprintf (current-error-port) "~a\n" l) + (eprintf "~a\n" l) (loop)))) (close-input-port (list-ref proc 3))))) @@ -569,8 +569,8 @@ (define exit-with-error? #f) (define (log-error format . args) - (fprintf (current-error-port) "Error ") - (apply fprintf (current-error-port) format args) + (eprintf "Error ") + (apply eprintf format args) (newline (current-error-port)) (set! exit-with-error? #t)) @@ -2472,8 +2472,7 @@ name)) (unless saw-gcing-call ' - (fprintf (current-error-port) - "[SUGGEST] Consider declaring ~a as __xform_nongcing__.\n" + (eprintf "[SUGGEST] Consider declaring ~a as __xform_nongcing__.\n" name))) (if (and (not important-conversion?) (not (and function-name @@ -3463,15 +3462,13 @@ ;; local vars taken in the function. (not (or (ormap (lambda (var) (and (array-type? (cdr var)) - '(fprintf (current-error-port) - "Optwarn [return] ~a in ~a: tail-push blocked by ~s[].\n" + '(eprintf "Optwarn [return] ~a in ~a: tail-push blocked by ~s[].\n" (tok-line (car func)) (tok-file (car func)) (car var)))) (live-var-info-vars live-vars)) (ormap (lambda (&-var) (and (assq &-var vars) - '(fprintf (current-error-port) - "Optwarn [return] ~a in ~a: tail-push blocked by &~s.\n" + '(eprintf "Optwarn [return] ~a in ~a: tail-push blocked by &~s.\n" (tok-line (car func)) (tok-file (car func)) &-var))) &-vars))))] diff --git a/collects/db/private/generic/common.rkt b/collects/db/private/generic/common.rkt index 079492b63a..c60bfb5cd8 100644 --- a/collects/db/private/generic/common.rkt +++ b/collects/db/private/generic/common.rkt @@ -87,7 +87,7 @@ (set! DEBUG? debug?)) (define/public (dprintf fmt . args) - (when DEBUG? (apply fprintf (current-error-port) fmt args))) + (when DEBUG? (apply eprintf fmt args))) )) ;; ---------------------------------------- diff --git a/collects/deinprogramm/deinprogramm-langs.rkt b/collects/deinprogramm/deinprogramm-langs.rkt index 9a27168f90..94a6ba551c 100644 --- a/collects/deinprogramm/deinprogramm-langs.rkt +++ b/collects/deinprogramm/deinprogramm-langs.rkt @@ -1189,8 +1189,8 @@ (if (exn? exn) (display (exn-message exn) (current-error-port)) - (fprintf (current-error-port) "uncaught exception: ~e" exn)) - (fprintf (current-error-port) "\n") + (eprintf "uncaught exception: ~e" exn)) + (eprintf "\n") ;; need to flush here so that error annotations inserted in next line ;; don't get erased if this output were to happen after the insertion diff --git a/collects/deinprogramm/signature/signature-unit.rkt b/collects/deinprogramm/signature/signature-unit.rkt index c608317da0..369a02ac78 100644 --- a/collects/deinprogramm/signature/signature-unit.rkt +++ b/collects/deinprogramm/signature/signature-unit.rkt @@ -135,7 +135,7 @@ (make-signature name (lambda (self obj) - ;;(write (list 'list obj) (current-error-port)) (newline (current-error-port)) + ;;(eprintf "~s\n" (list 'list obj)) (let recur ((l obj)) (define (go-on) @@ -153,7 +153,7 @@ obj) ((hash-ref lists-table l #f) => (lambda (seen) - ;;(write (list 'seen seen (eq? self (car seen))) (current-error-port)) (newline (current-error-port)) + ;;(eprintf "~s\n" (list 'seen seen (eq? self (car seen)))) (if (eq? self (car seen)) (cdr seen) (go-on)))) diff --git a/collects/drracket/drracket.rkt b/collects/drracket/drracket.rkt index 67c84307fc..3c1018eb6c 100644 --- a/collects/drracket/drracket.rkt +++ b/collects/drracket/drracket.rkt @@ -132,7 +132,7 @@ (printf "~a\n" msg) (printf "stdout from compiling ~a:\n~a\n" path out) (flush-output) - (fprintf (current-error-port) "stderr from compiling ~a:\n~a\n" path err)]))) + (eprintf "stderr from compiling ~a:\n~a\n" path err)]))) (flprintf "PLTDRPAR: installing compilation manager\n") (current-load/use-compiled (make-compilation-manager-load/use-compiled-handler))]) diff --git a/collects/drracket/private/debug.rkt b/collects/drracket/private/debug.rkt index 52a7b12e37..03bf4b7162 100644 --- a/collects/drracket/private/debug.rkt +++ b/collects/drracket/private/debug.rkt @@ -212,7 +212,7 @@ profile todo: ; (for-each loop (syntax->list stx))] ; [exp ; (set! exps (+ exps 1))])) - ; (fprintf (current-error-port) "exps: ~v\nwcms: ~v\n" exps wcms)) + ; (eprintf "exps: ~v\nwcms: ~v\n" exps wcms)) ; stx) ;; make-debug-eval-handler : (sexp -> value) -> sexp -> value @@ -459,8 +459,8 @@ profile todo: (current-error-port))] [else (display "" (current-error-port))]))] - [do-line/col (λ () (fprintf (current-error-port) ":~a:~a" line col))] - [do-pos (λ () (fprintf (current-error-port) "::~a" pos))] + [do-line/col (λ () (eprintf ":~a:~a" line col))] + [do-pos (λ () (eprintf "::~a" pos))] [src-loc-in-defs/ints? (let ([rep (drracket:rep:current-rep)]) (and rep diff --git a/collects/drracket/private/eval-helpers.rkt b/collects/drracket/private/eval-helpers.rkt index bb84e87f8a..64a69ec5a0 100644 --- a/collects/drracket/private/eval-helpers.rkt +++ b/collects/drracket/private/eval-helpers.rkt @@ -61,8 +61,7 @@ [cpaths (append-map (λ (x) (if (symbol? x) default (list x))) (prefab-module-settings-collection-paths settings))]) (when (null? cpaths) - (fprintf (current-error-port) - "WARNING: your collection paths are empty!\n")) + (eprintf "WARNING: your collection paths are empty!\n")) (current-library-collection-paths cpaths)) (compile-context-preservation-enabled (prefab-module-settings-full-trace? settings)) diff --git a/collects/drracket/private/language-configuration.rkt b/collects/drracket/private/language-configuration.rkt index f0189b7925..f577a46ff9 100644 --- a/collects/drracket/private/language-configuration.rkt +++ b/collects/drracket/private/language-configuration.rkt @@ -1636,7 +1636,7 @@ (define/override (first-opened) (not-a-language-message) - (fprintf (current-error-port) "\n")) + (eprintf "\n")) (define/override (front-end/interaction input settings) (not-a-language-message) @@ -1720,13 +1720,9 @@ (define o (case-lambda - [(arg) - (cond - [(string? arg) - (fprintf (current-error-port) arg)] - [(is-a? arg snip%) - (write-special arg (current-error-port))])] - [args (apply fprintf (current-error-port) args)])) + [(arg) (cond [(string? arg) (eprintf arg)] + [(is-a? arg snip%) (write-special arg (current-error-port))])] + [args (apply eprintf args)])) (define arrow-cursor (make-object cursor% 'arrow)) diff --git a/collects/drracket/private/module-language-tools.rkt b/collects/drracket/private/module-language-tools.rkt index 61825fbfd6..fd473a0e19 100644 --- a/collects/drracket/private/module-language-tools.rkt +++ b/collects/drracket/private/module-language-tools.rkt @@ -166,11 +166,13 @@ ; sometimes I get eof here, but I don't know why and can't seem to ;; make it happen outside of DrRacket (when (eof-object? info-result) - (fprintf (current-error-port) "file ~s produces eof from read-language\n" + (eprintf "file ~s produces eof from read-language\n" (send this get-filename)) - (fprintf (current-error-port) " port-next-location ~s\n" (call-with-values (λ () (port-next-location port)) list)) - (fprintf (current-error-port) " str ~s\n" (let ([s (send this get-text)]) - (substring s 0 (min 100 (string-length s))))) + (eprintf " port-next-location ~s\n" + (call-with-values (λ () (port-next-location port)) list)) + (eprintf " str ~s\n" + (let ([s (send this get-text)]) + (substring s 0 (min 100 (string-length s))))) (set! info-result #f)) (let-values ([(line col pos) (port-next-location port)]) (unless (equal? (get-text 0 pos) hash-lang-language) diff --git a/collects/drracket/private/module-language.rkt b/collects/drracket/private/module-language.rkt index 99fa7fb5cb..46de420b53 100644 --- a/collects/drracket/private/module-language.rkt +++ b/collects/drracket/private/module-language.rkt @@ -506,7 +506,7 @@ ;; raise the exception as normal. (It can happen in some rare cases like ;; having a single empty scheme box in the definitions.) (unless rep (if exn (raise exn) (error "\nInteractions disabled"))) - (when prefix (fprintf (current-error-port) "Module Language: ~a\n" prefix)) + (when prefix (eprintf "Module Language: ~a\n" prefix)) (when exn ((error-display-handler) (exn-message exn) exn)) ;; these are needed, otherwise the warning can appear before the output (flush-output (current-output-port)) diff --git a/collects/drracket/private/rep.rkt b/collects/drracket/private/rep.rkt index bed7dce817..4273baa377 100644 --- a/collects/drracket/private/rep.rkt +++ b/collects/drracket/private/rep.rkt @@ -1319,8 +1319,7 @@ TODO (set! raised-exn? #t)))) (drracket:language:setup-setup-values)))) (when raised-exn? - (fprintf - (current-error-port) + (eprintf (string-append "copied exn raised when setting up snip values" " (thunk passed as third argume to drracket:language:add-snip-value)\n")) diff --git a/collects/ffi/examples/use-tcl.rkt b/collects/ffi/examples/use-tcl.rkt index 268e664478..77a498d674 100755 --- a/collects/ffi/examples/use-tcl.rkt +++ b/collects/ffi/examples/use-tcl.rkt @@ -5,14 +5,11 @@ (require "tcl.rkt") (define (tcldemo . strs) - (for-each (lambda (s) - (printf "> ~a\n" s) - (with-handlers ([void (lambda (e) - (display (if (exn? e) (exn-message e) e) - (current-error-port)) - (newline (current-error-port)))]) - (printf "~a\n" (eval-tcl s)))) - strs)) + (for ([s (in-list strs)]) + (printf "> ~a\n" s) + (with-handlers ([void (lambda (e) + (eprintf "~a\n" (if (exn? e) (exn-message e) e)))]) + (printf "~a\n" (eval-tcl s))))) (tcldemo "puts 123" "puts $a" diff --git a/collects/framework/splash.rkt b/collects/framework/splash.rkt index 797e7e677a..92303af4f1 100644 --- a/collects/framework/splash.rkt +++ b/collects/framework/splash.rkt @@ -179,7 +179,7 @@ [(or (path? splash-draw-spec) (string? splash-draw-spec)) (unless (file-exists? splash-draw-spec) - (fprintf (current-error-port) "WARNING: bitmap path ~s not found\n" splash-draw-spec) + (eprintf "WARNING: bitmap path ~s not found\n" splash-draw-spec) (no-splash)) (set! splash-bitmap (make-object bitmap% splash-draw-spec))] @@ -187,7 +187,7 @@ (set! splash-bitmap splash-draw-spec)]) (unless (send splash-bitmap ok?) - (fprintf (current-error-port) "WARNING: bad bitmap ~s\n" splash-draw-spec) + (eprintf "WARNING: bad bitmap ~s\n" splash-draw-spec) (no-splash)) (send splash-canvas min-width (send splash-bitmap get-width)) @@ -208,8 +208,7 @@ [(not splash-draw-spec) (no-splash)] [else - (fprintf (current-error-port) - "WARNING: unknown splash spec: ~s" splash-draw-spec) + (eprintf "WARNING: unknown splash spec: ~s" splash-draw-spec) (no-splash)]) (refresh-splash) diff --git a/collects/frtime/core/frp.rkt b/collects/frtime/core/frp.rkt index 3e1986d751..ff30353e7a 100644 --- a/collects/frtime/core/frp.rkt +++ b/collects/frtime/core/frp.rkt @@ -613,9 +613,7 @@ (list (hash-ref named-dependents sym (lambda () dummy)) val)) (loop)] [msg - (fprintf (current-error-port) - "frtime engine: msg not understood: ~a\n" - msg) + (eprintf "frtime engine: msg not understood: ~a\n" msg) (loop)])) ;; enqueue expired timers for execution diff --git a/collects/frtime/lang-core.rkt b/collects/frtime/lang-core.rkt index 4503be98e6..8bfb8086f3 100644 --- a/collects/frtime/lang-core.rkt +++ b/collects/frtime/lang-core.rkt @@ -91,10 +91,10 @@ (opt-lambda (obj [mem empty]) (with-handlers ((exn:fail? (lambda (e) - (fprintf - (current-error-port) + (eprintf "you've encountered a bug in frtime. please send a report to the Racket mailing list.\nexn: ~a\n" - e) #f))) + e) + #f))) (cond [(memq obj mem) #f] [(behavior? obj) #t] diff --git a/collects/frtime/lang-ext.rkt b/collects/frtime/lang-ext.rkt index a26182a89a..53d4520d95 100644 --- a/collects/frtime/lang-ext.rkt +++ b/collects/frtime/lang-ext.rkt @@ -555,7 +555,7 @@ [proc-k (lambda (evt) (proc emit suspend evt) (set! proc-k #f))]) (let ([thunk (lambda () (when (ormap undefined? streams) - ;(fprintf (current-error-port) "had an undefined stream\n") + ;(eprintf "had an undefined stream\n") (set! streams (fix-streams streams args))) (let loop ([streams streams]) (extract (lambda (the-event strs) @@ -776,7 +776,7 @@ (syntax->list #'(exp ...)))]) #'(tag new-exp ...))] [x (begin - (fprintf (current-error-port) "snapshot-unbound: fell through on ~a\n" #'x) + (eprintf "snapshot-unbound: fell through on ~a\n" #'x) '())])))) (syntax-case stx () diff --git a/collects/games/chat-noir/chat-noir-unit.rkt b/collects/games/chat-noir/chat-noir-unit.rkt index ef16d5ba5e..0e804e8c95 100644 --- a/collects/games/chat-noir/chat-noir-unit.rkt +++ b/collects/games/chat-noir/chat-noir-unit.rkt @@ -59,8 +59,7 @@ [parent f] [callback (λ (x y) (show-help))] [label (string-constant help)]))]))] - [else - (fprintf (current-error-port) "never found a window\n")])))) + [else (eprintf "never found a window\n")])))) ;; start up the game diff --git a/collects/games/gcalc/gcalc.rkt b/collects/games/gcalc/gcalc.rkt index 50eaa38099..3d187da72d 100644 --- a/collects/games/gcalc/gcalc.rkt +++ b/collects/games/gcalc/gcalc.rkt @@ -105,9 +105,6 @@ (define 3rd caddr) (define 4th cadddr) -(define (eprintf . args) - (apply fprintf (current-error-port) args)) - (define (read-from-string str) (with-handlers ([void (lambda (x) #f)]) (let ([obj (read (open-input-string (string-append "(" str ")")))]) diff --git a/collects/games/paint-by-numbers/raw-problems/build-hattori.rkt b/collects/games/paint-by-numbers/raw-problems/build-hattori.rkt index f24405aa97..662d7d28ff 100644 --- a/collects/games/paint-by-numbers/raw-problems/build-hattori.rkt +++ b/collects/games/paint-by-numbers/raw-problems/build-hattori.rkt @@ -9,15 +9,12 @@ (define (main-n n) (let ([grid (calculate-grid (build-path 'up "hattori" (format "~a.gif" n)))]) (display-grid grid) - (pretty-print - (build-problem - n grid)) + (pretty-print (build-problem n grid)) (newline) - (newline (current-error-port)) - (newline (current-error-port)))) + (eprintf "\n\n"))) (define (calculate-grid filename) - (fprintf (current-error-port) "reading ~a\n" filename) + (eprintf "reading ~a\n" filename) (let* ([bitmap (make-object bitmap% filename)] [_ (unless (send bitmap ok?) (error 'bad-bitmap "name: ~a" filename))] @@ -34,12 +31,10 @@ [new-bitmap-height (floor (/ (- puzzle-height 1) pixel-size))]) (begin - (fprintf (current-error-port) "size of picture: ~a x ~a\n" raw-width raw-height) - (fprintf (current-error-port) " size of image: ~a x ~a\n" image-width image-height) - (fprintf (current-error-port) "grid-start (~a, ~a)\n" grid-x-start grid-y-start) - (fprintf (current-error-port) "size of puzzle: ~a x ~a\n" - puzzle-width - puzzle-height)) + (eprintf "size of picture: ~a x ~a\n" raw-width raw-height) + (eprintf " size of image: ~a x ~a\n" image-width image-height) + (eprintf "grid-start (~a, ~a)\n" grid-x-start grid-y-start) + (eprintf "size of puzzle: ~a x ~a\n" puzzle-width puzzle-height)) (reverse (let loop ([j new-bitmap-height]) (cond @@ -62,7 +57,7 @@ (* pixel-size (+ j -1 1/2))))) 'x 'o)]) - ;(fprintf (current-error-port) "(~a, ~a) is ~a\n" i j pixel-value) + ;(eprintf "(~a, ~a) is ~a\n" i j pixel-value) (cons pixel-value (loop (- i 1))))]))) (loop (- j 1)))]))))) diff --git a/collects/games/paint-by-numbers/raw-problems/build-rows-cols.rkt b/collects/games/paint-by-numbers/raw-problems/build-rows-cols.rkt index 0dbf7d00f0..d5b0594041 100644 --- a/collects/games/paint-by-numbers/raw-problems/build-rows-cols.rkt +++ b/collects/games/paint-by-numbers/raw-problems/build-rows-cols.rkt @@ -5,15 +5,14 @@ (when (equal? (vector) argv) (error 'build-rows-cols.rkt - "expected an image file on the command-line")) - + "expected an image file on the command-line")) + (define image (vector-ref argv 0)) -(fprintf (current-error-port) "processing ~a\n" image) +(eprintf "processing ~a\n" image) (define bitmap (make-object bitmap% image)) (when (send bitmap is-color?) - (fprintf (current-error-port) - "expected a monochrome bitmap -- all non-black spaces will be considered white\n")) + (eprintf "expected a monochrome bitmap -- all non-black spaces will be considered white\n")) (newline (current-error-port)) diff --git a/collects/games/paint-by-numbers/raw-problems/build-solution-sets.rkt b/collects/games/paint-by-numbers/raw-problems/build-solution-sets.rkt index 37abf3a419..475da053bf 100644 --- a/collects/games/paint-by-numbers/raw-problems/build-solution-sets.rkt +++ b/collects/games/paint-by-numbers/raw-problems/build-solution-sets.rkt @@ -205,10 +205,8 @@ The col and row type specs are in sig.rkt and the solution type is: (semaphore-wait kill) (set! sucessful? #f) (kill-thread k) - (fprintf (current-error-port) "\nsolver raised an exception\n~a\n" - (if (exn? x) - (exn-message x) - x)) + (eprintf "\nsolver raised an exception\n~a\n" + (if (exn? x) (exn-message x) x)) (semaphore-post done))]) (solve:solve rows cols set-entry (lambda (max) @@ -235,7 +233,7 @@ The col and row type specs are in sig.rkt and the solution type is: (void)))))) (semaphore-wait kill) (kill-thread t) - (fprintf (current-error-port) "\n memory limit expired.\n") + (eprintf "\n memory limit expired.\n") (collect-garbage)(collect-garbage)(collect-garbage)(collect-garbage)(collect-garbage) (update-memory-display) (semaphore-post done)))]) diff --git a/collects/games/paint-by-numbers/solve.rkt b/collects/games/paint-by-numbers/solve.rkt index 38f4a2c90e..16c8298b96 100644 --- a/collects/games/paint-by-numbers/solve.rkt +++ b/collects/games/paint-by-numbers/solve.rkt @@ -451,7 +451,7 @@ old-tries (let* ([least-difficult (apply min unmemoized)]) - ;(fprintf (current-error-port) "guessed tries: ~v\n" least-difficult) + ;(eprintf "guessed tries: ~v\n" least-difficult) (map (lambda (old-try-set block-list board-row) (cond [(and (number? old-try-set) (= old-try-set least-difficult)) (let ([spaces (spare-spaces block-list line-length)] diff --git a/collects/games/parcheesi/test.rkt b/collects/games/parcheesi/test.rkt index a3445b8e8f..b3dfb23fd5 100644 --- a/collects/games/parcheesi/test.rkt +++ b/collects/games/parcheesi/test.rkt @@ -9,9 +9,9 @@ (define (test-results) (cond [(= 0 (unbox failure-count)) - (fprintf (current-error-port) "All ~a tests passed." (unbox test-count))] + (eprintf "All ~a tests passed." (unbox test-count))] [else - (fprintf (current-error-port) "~a tests failed, ~a tests total" + (eprintf "~a tests failed, ~a tests total" (unbox failure-count) (unbox test-count))])) @@ -23,8 +23,7 @@ (with-handlers ([pred (lambda (x) (void))]) (when show-tests? (printf "> running test ~s\n" line)) (set-box! test-count (+ (unbox test-count) 1)) - (fprintf (current-error-port) - "test ~a ~s:\n expected error, got ~a\n\n" + (eprintf "test ~a ~s:\n expected error, got ~a\n\n" line 'actual (flatten-list (call-with-values (lambda () actual) list))) @@ -46,9 +45,9 @@ (set-box! test-count (+ (unbox test-count) 1)) (unless (equal? actual-xs expect-xs) (set-box! failure-count (+ (unbox failure-count) 1)) - (fprintf (current-error-port) "test ~a ~s:\ngot:\n" line 'actual) + (eprintf "test ~a ~s:\ngot:\n" line 'actual) (for-each (lambda (x) (pretty-print x (current-error-port))) actual-xs) - (fprintf (current-error-port) "expected:\n") + (eprintf "expected:\n") (for-each (lambda (x) (pretty-print x (current-error-port))) expect-xs))))))])) (define-syntax (test-list stx) @@ -63,11 +62,8 @@ [show-err (lambda (in not-in val) (set-box! failure-count (+ (unbox failure-count) 1)) - (fprintf (current-error-port) "test ~a ~s found in ~a but not in ~a:\n" - line - 'actual - in - not-in) + (eprintf "test ~a ~s found in ~a but not in ~a:\n" + line 'actual in not-in) (pretty-print val (current-error-port)))]) (set-box! test-count (+ (unbox test-count) 1)) (for-each (lambda (one-actual) diff --git a/collects/games/pousse/counter.rkt b/collects/games/pousse/counter.rkt index a7ff48d2a0..14ed0e08d9 100644 --- a/collects/games/pousse/counter.rkt +++ b/collects/games/pousse/counter.rkt @@ -69,8 +69,7 @@ (set! thems (/ thems 2))) '(when (= depth 2) - (fprintf (current-error-port) - "us: ~a them: ~a u-m:~a t-m: ~a u-l: ~a t-l: ~a u-c: ~a t-c: ~a\n" + (eprintf "us: ~a them: ~a u-m:~a t-m: ~a u-l: ~a t-l: ~a u-c: ~a t-c: ~a\n" usses thems middle-usses middle-thems us-in-line them-in-line diff --git a/collects/games/pousse/robot.rkt b/collects/games/pousse/robot.rkt index 2b6feee7ce..997b2daf1d 100644 --- a/collects/games/pousse/robot.rkt +++ b/collects/games/pousse/robot.rkt @@ -125,7 +125,7 @@ (- (car gf) good-so-far))]) '(when (and (= depth RECURSION-DEPTH)) - (fprintf (current-error-port) "Returned goodness: ~a\n" (car move)) + (eprintf "Returned goodness: ~a\n" (car move)) (print-board (cadr gf) (current-error-port))) (let ([g (car move)]) @@ -153,7 +153,7 @@ '(when (and (= depth RECURSION-DEPTH)) (for-each (lambda (gf) - (fprintf (current-error-port) "Goodness: ~a\n" (car gf)) + (eprintf "Goodness: ~a\n" (car gf)) (print-board (cadr gf) (current-error-port))) good-futures)) @@ -263,9 +263,9 @@ (thread (lambda () (let loop ([iteration 0]) - ; (fprintf (current-error-port) "Starting iteration ~a\n" iteration) + ; (eprintf "Starting iteration ~a\n" iteration) (set! result (f iteration)) - '(fprintf (current-error-port) " [finished iteration depth ~a: ~a~a]\n" + '(eprintf " [finished iteration depth ~a: ~a~a]\n" iteration (cadr result) (add1 (cddr result))) (unless (or (pair? (car result))) (loop (add1 iteration))))))) @@ -282,7 +282,7 @@ (define (go) '(begin - (fprintf (current-error-port) "Start:\n") + (eprintf "Start:\n") (print-board board (current-error-port))) (let* ([go (lambda (i) (set! RECURSION-DEPTH i) @@ -292,10 +292,8 @@ (go depth) (use-up-time go))]) '(when (pair? (car result)) - (fprintf (current-error-port) "we ~a\n" - (if (= (caar result) LOSER-GOODNESS) - "lose" - "win"))) + (eprintf "we ~a\n" + (if (= (caar result) LOSER-GOODNESS) "lose" "win"))) (output-move (cdr result)))) ;; Given (cons ), returns the move diff --git a/collects/gui-debugger/debug-tool.rkt b/collects/gui-debugger/debug-tool.rkt index 52a7f41ef3..fcf0151978 100644 --- a/collects/gui-debugger/debug-tool.rkt +++ b/collects/gui-debugger/debug-tool.rkt @@ -942,7 +942,7 @@ (define/public (print-to-console v) ;; ==drscheme eventspace thread== ;; only when a user thread is suspended - (do-in-user-thread (lambda () (fprintf (current-error-port) " ### DEBUGGER: ~s\n" v)))) + (do-in-user-thread (lambda () (eprintf " ### DEBUGGER: ~s\n" v)))) (define (frame->end-breakpoint-status frame) (let/ec k diff --git a/collects/handin-server/private/config.rkt b/collects/handin-server/private/config.rkt index 1fe0958c7f..bdcc875309 100644 --- a/collects/handin-server/private/config.rkt +++ b/collects/handin-server/private/config.rkt @@ -37,9 +37,7 @@ ;; write anything if this is the first read, since the logger ;; is not initialized yet (and if there's an error at this ;; stage, the server will exit) - (fprintf (current-error-port) - (format "reloading configuration from ~a\n" - config-file))) + (eprintf (format "reloading configuration from ~a\n" config-file))) (let ([c (with-input-from-file config-file read)]) (if (and (list? c) (andmap (lambda (x) diff --git a/collects/handin-server/private/logger.rkt b/collects/handin-server/private/logger.rkt index 5dc3ded85b..8ff55b70a3 100644 --- a/collects/handin-server/private/logger.rkt +++ b/collects/handin-server/private/logger.rkt @@ -9,8 +9,8 @@ ;; string to print in one shot, and flushes the output) (provide log-line) (define (log-line fmt . args) - (let ([line (format "~a\n" (apply format fmt args))]) - (display line (current-error-port)))) + (define line (format "~a\n" (apply format fmt args))) + (display line (current-error-port))) (define (prefix) (parameterize ([date-display-format 'iso-8601]) diff --git a/collects/lang/htdp-langs.rkt b/collects/lang/htdp-langs.rkt index 33683a8226..6c6ee73510 100644 --- a/collects/lang/htdp-langs.rkt +++ b/collects/lang/htdp-langs.rkt @@ -996,8 +996,8 @@ (define (teaching-languages-error-display-handler msg exn) (if (exn? exn) (display (get-rewriten-error-message exn) (current-error-port)) - (fprintf (current-error-port) "uncaught exception: ~e" exn)) - (fprintf (current-error-port) "\n") + (eprintf "uncaught exception: ~e" exn)) + (eprintf "\n") ;; need to flush here so that error annotations inserted in next line ;; don't get erased if this output were to happen after the insertion diff --git a/collects/macro-debugger/model/deriv-parser.rkt b/collects/macro-debugger/model/deriv-parser.rkt index 1290e47871..8b1325b2ff 100644 --- a/collects/macro-debugger/model/deriv-parser.rkt +++ b/collects/macro-debugger/model/deriv-parser.rkt @@ -164,9 +164,7 @@ [(enter-prim (? Prim) exit-prim return) (begin (unless (eq? $3 $4) - (fprintf (current-error-port) - "warning: exit-prim and return differ:\n~s\n~s\n" - $3 $4)) + (eprintf "warning: exit-prim and return differ:\n~s\n~s\n" $3 $4)) ($2 $1 $3 rs))] [((? MacroStep) (? EE)) ($1 e1 rs $2)]) diff --git a/collects/macro-debugger/model/reductions-config.rkt b/collects/macro-debugger/model/reductions-config.rkt index 599ff05195..e6ab4fb81e 100644 --- a/collects/macro-debugger/model/reductions-config.rkt +++ b/collects/macro-debugger/model/reductions-config.rkt @@ -285,12 +285,10 @@ ;; But for now, just drop it to avoid macro stepper error. ;; Only bad effect should be missed subterms (usually at phase1). (STRICT-CHECKS - (fprintf (current-error-port) - "from:\n~.s\n\nto:\n~.s\n\n" + (eprintf "from:\n~.s\n\nto:\n~.s\n\n" (stx->datum from) (stx->datum to)) - (fprintf (current-error-port) - "original from:\n~.s\n\noriginal to:\n~.s\n\n" + (eprintf "original from:\n~.s\n\noriginal to:\n~.s\n\n" (stx->datum from0) (stx->datum to0)) (error 'add-to-renames-table)) diff --git a/collects/macro-debugger/model/reductions-engine.rkt b/collects/macro-debugger/model/reductions-engine.rkt index 7f43d2bd6f..7e9ea22d75 100644 --- a/collects/macro-debugger/model/reductions-engine.rkt +++ b/collects/macro-debugger/model/reductions-engine.rkt @@ -540,17 +540,13 @@ [expected-datum (stx->datum expected)] [same-form? (equal? actual-datum expected-datum)]) (if same-form? - (fprintf (current-error-port) - "same form but wrong wrappings:\n~.s\nwrongness:\n~.s\n" + (eprintf "same form but wrong wrappings:\n~.s\nwrongness:\n~.s\n" actual-datum (wrongness actual expected)) - (fprintf (current-error-port) - "got:\n~.s\n\nexpected:\n~.s\n" + (eprintf "got:\n~.s\n\nexpected:\n~.s\n" actual-datum expected-datum)) - (for ([d derivs]) - (fprintf (current-error-port) - "\n~.s\n" d)) + (for ([d derivs]) (eprintf "\n~.s\n" d)) (error function (if same-form? "wrong starting point (wraps)!" diff --git a/collects/macro-debugger/model/reductions.rkt b/collects/macro-debugger/model/reductions.rkt index c7b9241d38..0f54430a69 100644 --- a/collects/macro-debugger/model/reductions.rkt +++ b/collects/macro-debugger/model/reductions.rkt @@ -760,7 +760,7 @@ ;; lift-error (define (lift-error sym . args) - (apply fprintf (current-error-port) args) + (apply eprintf args) (newline (current-error-port)) (when #f (apply error sym args))) diff --git a/collects/meta/checker.rkt b/collects/meta/checker.rkt index eb84cbf135..15817d338b 100644 --- a/collects/meta/checker.rkt +++ b/collects/meta/checker.rkt @@ -448,8 +448,7 @@ (if 1st? (begin (unless (equal? version v) - (fprintf (current-error-port) - "\nNOTE: bundling a different version from ~a\n\n" + (eprintf "\nNOTE: bundling a different version from ~a\n\n" "running process")) (set! version v) (set! 1st? #f)) diff --git a/collects/meta/drdr/plt-build.rkt b/collects/meta/drdr/plt-build.rkt index 352c741990..9f4b51ab75 100644 --- a/collects/meta/drdr/plt-build.rkt +++ b/collects/meta/drdr/plt-build.rkt @@ -137,7 +137,7 @@ (the-process _stdout stdin _stderr) (parameterize ([subprocess-group-enabled #t]) (apply subprocess - (current-error-port) + (current-error-port) #f (current-error-port) new-command new-args))) diff --git a/collects/meta/drdr/replay.rkt b/collects/meta/drdr/replay.rkt index b3c122e16e..c9364323dd 100644 --- a/collects/meta/drdr/replay.rkt +++ b/collects/meta/drdr/replay.rkt @@ -5,17 +5,15 @@ (define replay-event (match-lambda - [(struct stdout (bs)) - (fprintf (current-output-port) "~a\n" bs)] - [(struct stderr (bs)) - (fprintf (current-error-port) "~a\n" bs)])) + [(struct stdout (bs)) (printf "~a\n" bs)] + [(struct stderr (bs)) (eprintf "~a\n" bs)])) (define (replay-status s) (for-each replay-event (status-output-log s)) #;(when (timeout? s) - (fprintf (current-error-port) "[replay-log] TIMEOUT!\n")) + (eprintf "[replay-log] TIMEOUT!\n")) #;(when (exit? s) - (fprintf (current-error-port) "[replay-log] Exit code: ~a\n" (exit-code s))) + (eprintf "[replay-log] Exit code: ~a\n" (exit-code s))) #;(printf "[replay-log] Took ~a\n" (format-duration-ms (status-duration s))) (replay-exit-code s)) diff --git a/collects/mrlib/private/aligned-pasteboard/tests/test-macro.rkt b/collects/mrlib/private/aligned-pasteboard/tests/test-macro.rkt index 5dcd9b60e4..096735e6b3 100644 --- a/collects/mrlib/private/aligned-pasteboard/tests/test-macro.rkt +++ b/collects/mrlib/private/aligned-pasteboard/tests/test-macro.rkt @@ -13,5 +13,5 @@ actual)]) (unless (and (not (exn? result)) (test result expected)) - (fprintf (current-error-port) "test failed: ~s != ~s\n" result expected)))))) + (eprintf "test failed: ~s != ~s\n" result expected)))))) ) diff --git a/collects/mzlib/deflate.rkt b/collects/mzlib/deflate.rkt index 37b615c4e4..9ebc7bc095 100644 --- a/collects/mzlib/deflate.rkt +++ b/collects/mzlib/deflate.rkt @@ -64,7 +64,7 @@ (make-gzbytes (gzbytes-bytes v) (+ (gzbytes-offset v) o))) (define (Trace stderr str . args) - (apply fprintf (current-error-port) str args)) + (apply eprintf str args)) (define Tracevv Trace) (define Tracev Trace) (define (Tracec test . args) diff --git a/collects/mzlib/restart.rkt b/collects/mzlib/restart.rkt index 55f99dbf9c..23ee17079e 100644 --- a/collects/mzlib/restart.rkt +++ b/collects/mzlib/restart.rkt @@ -17,8 +17,8 @@ [print-error (lambda (e) (if (exn? e) - (fprintf (current-error-port) "~a\n" (exn-message e)) - (fprintf (current-error-port) "Exception in init file: ~e\n" e)))] + (eprintf "~a\n" (exn-message e)) + (eprintf "Exception in init file: ~e\n" e)))] [beginize (lambda (l) (string-append "(begin " diff --git a/collects/mzlib/zip.rkt b/collects/mzlib/zip.rkt index 50cec2ded3..e67c2dbf3e 100644 --- a/collects/mzlib/zip.rkt +++ b/collects/mzlib/zip.rkt @@ -93,7 +93,7 @@ [mark1 #f] [mark2 #f]) (when (zip-verbose) - (fprintf (current-error-port) "zip: compressing ~a...\n" filename)) + (eprintf "zip: compressing ~a...\n" filename)) ;; write the contents to the output stream: (write-int *local-file-header* 4) ; signature (write-int *required-version* 2) ; version @@ -254,10 +254,10 @@ (zip-one-entry (build-metadata file) seekable?)) files)]) (when (zip-verbose) - (fprintf (current-error-port) "zip: writing headers...\n")) + (eprintf "zip: writing headers...\n")) (write-central-directory headers)) (when (zip-verbose) - (fprintf (current-error-port) "zip: done.\n")))) + (eprintf "zip: done.\n")))) ;; zip : output-file paths -> (provide zip) diff --git a/collects/net/qp.rkt b/collects/net/qp.rkt index 7522a6c863..779f6831c4 100644 --- a/collects/net/qp.rkt +++ b/collects/net/qp.rkt @@ -103,10 +103,7 @@ (loop (read-byte in))])))) (define (warning msg . args) - (when #f - (fprintf (current-error-port) - (apply format msg args)) - (newline (current-error-port)))) + (when #f (eprintf "~a\n" (apply format msg args)))) (define (hex-digit? i) (vector-ref hex-values i)) diff --git a/collects/parser-tools/private-yacc/table.rkt b/collects/parser-tools/private-yacc/table.rkt index f3df04181d..7eef2e2d3d 100644 --- a/collects/parser-tools/private-yacc/table.rkt +++ b/collects/parser-tools/private-yacc/table.rkt @@ -158,8 +158,7 @@ (prod-index (reduce-prod current-guess)))) (loop (car rest) (cdr rest))) ((accept? (car rest)) - (fprintf (current-error-port) - "accept/reduce or accept/shift conflicts. Check the grammar for useless cycles of productions\n") + (eprintf "accept/reduce or accept/shift conflicts. Check the grammar for useless cycles of productions\n") (loop current-guess (cdr rest))) (else (loop current-guess (cdr rest))))))))) @@ -179,13 +178,11 @@ grouped-table))) (unless suppress (when (> SR-conflicts 0) - (fprintf (current-error-port) - "~a shift/reduce conflict~a\n" + (eprintf "~a shift/reduce conflict~a\n" SR-conflicts (if (= SR-conflicts 1) "" "s"))) (when (> RR-conflicts 0) - (fprintf (current-error-port) - "~a reduce/reduce conflict~a\n" + (eprintf "~a reduce/reduce conflict~a\n" RR-conflicts (if (= RR-conflicts 1) "" "s")))) table)) @@ -281,8 +278,7 @@ (unless (string=? file "") (with-handlers [(exn:fail:filesystem? (lambda (e) - (fprintf - (current-error-port) + (eprintf "Cannot write debug output to file \"~a\": ~a\n" file (exn-message e))))] diff --git a/collects/parser-tools/yacc.rkt b/collects/parser-tools/yacc.rkt index 9a3cc3c649..5e2af6a4bd 100644 --- a/collects/parser-tools/yacc.rkt +++ b/collects/parser-tools/yacc.rkt @@ -172,8 +172,7 @@ (when (and yacc-output (not (string=? yacc-output ""))) (with-handlers [(exn:fail:filesystem? (lambda (e) - (fprintf - (current-error-port) + (eprintf "Cannot write yacc-output to file \"~a\"\n" yacc-output)))] (call-with-output-file yacc-output diff --git a/collects/planet/private/cmdline-tool.rkt b/collects/planet/private/cmdline-tool.rkt index 813c4a61aa..be7dfd4626 100644 --- a/collects/planet/private/cmdline-tool.rkt +++ b/collects/planet/private/cmdline-tool.rkt @@ -133,7 +133,7 @@ This command does not unpack or install the named .plt file." (define (verify-package-name pkg) (unless (regexp-match #rx"\\.plt$" pkg) - (fprintf (current-error-port) "Expected package name to end with '.plt', got: ~a\n" pkg) + (eprintf "Expected package name to end with '.plt', got: ~a\n" pkg) (exit 1))) diff --git a/collects/planet/util.rkt b/collects/planet/util.rkt index b6066bcf95..ed83e06320 100644 --- a/collects/planet/util.rkt +++ b/collects/planet/util.rkt @@ -434,9 +434,8 @@ (for-each display (reverse announcements)) (newline) - (for-each - (λ (s) (fprintf (current-error-port) "WARNING:\n\t~a\n" s)) - (reverse warnings)))) + (for-each (λ (s) (eprintf "WARNING:\n\t~a\n" s)) + (reverse warnings)))) (simple-form-path archive-name))])) @@ -800,8 +799,7 @@ (unless (directory-exists? path) (if (file-exists? path) (error 'add-hard-link "Hard links must point to directories, not files") - (fprintf (current-error-port) - "Warning: directory ~a does not exist\n" + (eprintf "Warning: directory ~a does not exist\n" (path->string path)))) (add-hard-link! pkg-name (list owner) maj min path)) diff --git a/collects/plot/common/deprecation-warning.rkt b/collects/plot/common/deprecation-warning.rkt index 4bdf4767d6..b651c5504b 100644 --- a/collects/plot/common/deprecation-warning.rkt +++ b/collects/plot/common/deprecation-warning.rkt @@ -11,10 +11,8 @@ (hash-ref! warnings name (λ () (if replacement-name - (fprintf (current-error-port) - "~a is deprecated and may be removed in the future; use ~a instead~n" + (eprintf "~a is deprecated and may be removed in the future; use ~a instead~n" name replacement-name) - (fprintf (current-error-port) - "~a is deprecated and may be removed in the future" + (eprintf "~a is deprecated and may be removed in the future" name)) #t)))) diff --git a/collects/profile/main.rkt b/collects/profile/main.rkt index 9827f42670..6a2582737e 100644 --- a/collects/profile/main.rkt +++ b/collects/profile/main.rkt @@ -28,8 +28,7 @@ (loop))))))) (define (run) (for ([i (in-range rpt)]) (thunk))) (with-handlers ([void (lambda (e) - (fprintf (current-error-port) - "profiled thunk error: ~a\n" + (eprintf "profiled thunk error: ~a\n" (if (exn? e) (exn-message e) (format "~e" e))))]) diff --git a/collects/racket/enter.rkt b/collects/racket/enter.rkt index 2bec54c60f..d9c719fa6e 100644 --- a/collects/racket/enter.rkt +++ b/collects/racket/enter.rkt @@ -61,8 +61,7 @@ (define notify (if (or (memq '#:verbose flags) (and re? (memq '#:verbose-reload flags))) (lambda (path) - (fprintf (current-error-port) - " [~aloading ~a]\n" (if re? "re-" "") path)) + (eprintf " [~aloading ~a]\n" (if re? "re-" "") path)) void)) (lambda (path name) (if name diff --git a/collects/raco/all-tools.rkt b/collects/raco/all-tools.rkt index 4875cf212c..a0d16b7e4c 100644 --- a/collects/raco/all-tools.rkt +++ b/collects/raco/all-tools.rkt @@ -23,8 +23,7 @@ (real? (list-ref entry 3)))) (let ([p (hash-ref tools (car entry) #f)]) (when p - (fprintf - (current-error-port) + (eprintf "warning: tool ~s registered twice: ~e and ~e\n" (car entry) (car p) @@ -44,9 +43,7 @@ entry))]) (hash-set! tools (car entry) entry))] [else - (fprintf - (current-error-port) - "warning: ~s provided bad `raco-commands' spec: ~e\n" - d - entry)])))) + (eprintf "warning: ~s provided bad `raco-commands' spec: ~e\n" + d + entry)])))) tools)) diff --git a/collects/raco/raco.rkt b/collects/raco/raco.rkt index 9b313155ee..7cb91e8a0e 100644 --- a/collects/raco/raco.rkt +++ b/collects/raco/raco.rkt @@ -36,7 +36,7 @@ (equal? (car cmdline) "-h")) #t] [(regexp-match? #rx"^-" (car cmdline)) - (fprintf (current-error-port) "~a: A flag must follow a command: ~a\n\n" + (eprintf "~a: A flag must follow a command: ~a\n\n" (find-system-path 'run-file) (car cmdline)) #f] @@ -45,7 +45,7 @@ => (lambda (tool) (if (eq? 'ambiguous tool) (begin - (fprintf (current-error-port) "~a: Ambiguous command prefix: ~a\n\n" + (eprintf "~a: Ambiguous command prefix: ~a\n\n" (find-system-path 'run-file) (car cmdline)) #f) @@ -56,16 +56,15 @@ (exit))))] [(equal? (car cmdline) "help") #t] [else - (fprintf (current-error-port) "~a: Unrecognized command: ~a\n\n" + (eprintf "~a: Unrecognized command: ~a\n\n" (find-system-path 'run-file) (car cmdline)) #f])]) - (fprintf (current-error-port) "Usage: raco