From 675332b48d17fe762d2bcb768566de6234eec5d3 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Fri, 13 Jan 2017 01:04:41 -0800 Subject: [PATCH] Eliminate use of deprecated guarantee-FOO-port procedures. --- src/edwin/lisppaste.scm | 9 ++++----- src/runtime/error.scm | 4 ++-- src/runtime/fileio.scm | 2 +- src/runtime/output.scm | 4 ++-- src/runtime/regsexp.scm | 2 +- src/runtime/stream.scm | 2 +- src/runtime/usrint.scm | 10 ++++------ 7 files changed, 15 insertions(+), 18 deletions(-) diff --git a/src/edwin/lisppaste.scm b/src/edwin/lisppaste.scm index 875ac1156..039d03813 100644 --- a/src/edwin/lisppaste.scm +++ b/src/edwin/lisppaste.scm @@ -144,11 +144,10 @@ With a prefix argument, list pastes starting at a certain number." (else (list count))))) (define (show-lisppaste entry #!optional port) - (let ((port (if (default-object? port) - (current-output-port) - (begin - (guarantee-output-port port 'SHOW-LISPPASTE) - port)))) + (let ((port + (if (default-object? port) + (current-output-port) + (guarantee textual-output-port? port 'SHOW-LISPPASTE)))) (receive (number time author channel title annotations content) (lisppaste-entry/components entry) (write-string "Paste " port) diff --git a/src/runtime/error.scm b/src/runtime/error.scm index df2a827dd..d3064e2dc 100644 --- a/src/runtime/error.scm +++ b/src/runtime/error.scm @@ -288,7 +288,7 @@ USA. (define (write-condition-report condition port) (guarantee-condition condition 'WRITE-CONDITION-REPORT) - (guarantee-output-port port 'WRITE-CONDITION-REPORT) + (guarantee textual-output-port? port 'WRITE-CONDITION-REPORT) (let ((reporter (%condition-type/reporter (%condition/type condition)))) (if (%condition/error? condition) (ignore-errors (lambda () (reporter condition port))) @@ -352,7 +352,7 @@ USA. (define (write-restart-report restart port) (guarantee-restart restart 'WRITE-RESTART-REPORT) - (guarantee-output-port port 'WRITE-RESTART-REPORT) + (guarantee textual-output-port? port 'WRITE-RESTART-REPORT) (let ((reporter (%restart/reporter restart))) (if (string? reporter) (write-string reporter port) diff --git a/src/runtime/fileio.scm b/src/runtime/fileio.scm index 237bb506c..f4047bbe5 100644 --- a/src/runtime/fileio.scm +++ b/src/runtime/fileio.scm @@ -84,7 +84,7 @@ USA. position)) (define (guarantee-positionable-port port caller) - (guarantee-port port caller) + (guarantee textual-port? port caller) (if (and (i/o-port? port) (not (eq? (input-port-channel port) (output-port-channel port)))) (error:bad-range-argument port caller)) diff --git a/src/runtime/output.scm b/src/runtime/output.scm index 3c36d1924..949a078e6 100644 --- a/src/runtime/output.scm +++ b/src/runtime/output.scm @@ -174,7 +174,7 @@ USA. (if (not (list-of-type? strings string?)) (error:wrong-type-argument strings "list of strings" 'WRITE-STRINGS-IN-COLUMNS)) - (guarantee-output-port port 'WRITE-STRINGS-IN-COLUMNS) + (guarantee textual-output-port? port 'WRITE-STRINGS-IN-COLUMNS) (guarantee-exact-positive-integer min-minor 'WRITE-STRINGS-IN-COLUMNS) (guarantee-string left-margin 'WRITE-STRINGS-IN-COLUMNS) (guarantee-string col-sep 'WRITE-STRINGS-IN-COLUMNS) @@ -299,7 +299,7 @@ USA. (pair? strings)) (error:wrong-type-argument strings "non-empty list of strings" 'WRITE-STRINGS-IN-PARAGRAPH)) - (guarantee-output-port port 'WRITE-STRINGS-IN-PARAGRAPH) + (guarantee textual-output-port? port 'WRITE-STRINGS-IN-PARAGRAPH) (guarantee-exact-positive-integer width 'WRITE-STRINGS-IN-PARAGRAPH) (guarantee-exact-nonnegative-integer indent 'WRITE-STRINGS-IN-PARAGRAPH) (guarantee-exact-nonnegative-integer first 'WRITE-STRINGS-IN-PARAGRAPH) diff --git a/src/runtime/regsexp.scm b/src/runtime/regsexp.scm index ffc1d669f..60c12594c 100644 --- a/src/runtime/regsexp.scm +++ b/src/runtime/regsexp.scm @@ -560,7 +560,7 @@ USA. (define (regsexp-match-input-port crsexp port) (let ((caller 'REGSEXP-MATCH-INPUT-PORT)) (guarantee-compiled-regsexp crsexp caller) - (guarantee-input-port port caller) + (guarantee textual-input-port? port caller) (%top-level-match crsexp (%char-source->position (lambda () diff --git a/src/runtime/stream.scm b/src/runtime/stream.scm index e8f8dc71b..e436af828 100644 --- a/src/runtime/stream.scm +++ b/src/runtime/stream.scm @@ -241,7 +241,7 @@ USA. (let ((port (if (default-object? port) (current-output-port) - (guarantee-output-port port 'STREAM-WRITE)))) + (guarantee textual-output-port? port 'STREAM-WRITE)))) (if (stream-pair? stream) (begin (write-char #\{ port) diff --git a/src/runtime/usrint.scm b/src/runtime/usrint.scm index b5dbef379..271420d2d 100644 --- a/src/runtime/usrint.scm +++ b/src/runtime/usrint.scm @@ -41,7 +41,7 @@ USA. (if operation (operation port environment prompt level) (begin - (guarantee-i/o-port port 'PROMPT-FOR-COMMAND-EXPRESSION) + (guarantee textual-i/o-port? port 'PROMPT-FOR-COMMAND-EXPRESSION) (write-command-prompt port prompt level) (with-input-port-terminal-mode port 'COOKED (lambda () @@ -71,7 +71,7 @@ USA. (if operation (operation port environment prompt) (begin - (guarantee-i/o-port port caller) + (guarantee textual-i/o-port? port caller) (with-output-port-terminal-mode port 'COOKED (lambda () (fresh-line port) @@ -85,9 +85,7 @@ USA. (define (optional-port port caller) (if (default-object? port) (interaction-i/o-port) - (begin - (guarantee-port port caller) - port))) + (guarantee textual-port? port caller))) (define (optional-environment environment caller) (if (default-object? environment) @@ -238,7 +236,7 @@ USA. (port/set-line-ending port outside) (set! outside))))))) - (guarantee-i/o-port port 'default/call-with-pass-phrase) + (guarantee textual-i/o-port? port 'default/call-with-pass-phrase) (with-output-port-terminal-mode port 'COOKED (lambda () (fresh-line port) -- 2.25.1