From 66999bd7a884e7b7d641b0a864202840051eb6a1 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Tue, 8 May 2018 21:59:47 -0700 Subject: [PATCH] Implement current-error-port. --- src/runtime/runtime.pkg | 4 +--- src/runtime/textual-port.scm | 19 ++++++------------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/src/runtime/runtime.pkg b/src/runtime/runtime.pkg index 9ee61acf4..1a068da87 100644 --- a/src/runtime/runtime.pkg +++ b/src/runtime/runtime.pkg @@ -2667,12 +2667,10 @@ USA. with-output-to-port with-trace-output-port) (export () - ;; Temporary definition to satisfy R7RS - ;; TODO(cph): provide a proper definition - (current-error-port current-output-port) close-input-port close-output-port close-port + current-error-port current-input-port current-output-port i/o-port? diff --git a/src/runtime/textual-port.scm b/src/runtime/textual-port.scm index 55c09c15b..e853b5123 100644 --- a/src/runtime/textual-port.scm +++ b/src/runtime/textual-port.scm @@ -763,19 +763,12 @@ USA. ;;;; Standard Ports -(define current-input-port) -(define current-output-port) -(define notification-output-port) -(define trace-output-port) -(define interaction-i/o-port) -(add-boot-init! - (lambda () - (set! current-input-port (make-port-parameter input-port?)) - (set! current-output-port (make-port-parameter output-port?)) - (set! notification-output-port (make-port-parameter output-port?)) - (set! trace-output-port (make-port-parameter output-port?)) - (set! interaction-i/o-port (make-port-parameter i/o-port?)) - unspecific)) +(define-deferred current-input-port (make-port-parameter input-port?)) +(define-deferred current-output-port (make-port-parameter output-port?)) +(define-deferred current-error-port (make-port-parameter output-port?)) +(define-deferred notification-output-port (make-port-parameter output-port?)) +(define-deferred trace-output-port (make-port-parameter output-port?)) +(define-deferred interaction-i/o-port (make-port-parameter i/o-port?)) (define (make-port-parameter predicate) (make-general-parameter #f -- 2.25.1