From b25c8c5c80aeab9cbf4943cf0330c3e476f62876 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Thu, 18 Feb 1999 04:04:43 +0000 Subject: [PATCH] * Add mechanism to encapsulate one port in another, and to build wrappers around selected operations on the encapsulated port. * Use new encapsulation mechanism to reimplement transcript facility so that each transcript is associated with a particular REPL. Previously the transcript was directly associated with the console port. This change is the goal of all of the port changes from this past week. (I'm a little surprised at the depth of changes required.) This has the side effect of increasing modularity, since the transcript code is now concentrated in one file rather than being integrated into the console port. * Export procedure OUTPUT-PORT/FRESH-LINE to the global environment. This was an oversight from previous changes. --- v7/src/runtime/runtime.pkg | 17 +++++++++++++---- v7/src/runtime/version.scm | 4 ++-- v8/src/runtime/runtime.pkg | 17 +++++++++++++---- 3 files changed, 28 insertions(+), 10 deletions(-) diff --git a/v7/src/runtime/runtime.pkg b/v7/src/runtime/runtime.pkg index af43cc64e..4950a8a26 100644 --- a/v7/src/runtime/runtime.pkg +++ b/v7/src/runtime/runtime.pkg @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: runtime.pkg,v 14.314 1999/02/16 20:11:18 cph Exp $ +$Id: runtime.pkg,v 14.315 1999/02/18 04:01:40 cph Exp $ Copyright (c) 1988-1999 Massachusetts Institute of Technology @@ -821,8 +821,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (export () transcript-off transcript-on) - (export (runtime console-i/o-port) - transcript-port) + (export (runtime rep) + make-transcriptable-port) (initialization (initialize-package!))) (define-package (runtime format) @@ -910,7 +910,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. make-generic-input-port make-generic-output-port) (export (runtime console-i/o-port) - generic-i/o-type) + generic-i/o-type + operation/flush-output) (export (runtime file-i/o-port) generic-i/o-type generic-input-type @@ -1045,9 +1046,14 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. close-port current-input-port current-output-port + encapsulated-port/port + encapsulated-port/state + encapsulated-port? + guarantee-encapsulated-port guarantee-i/o-port guarantee-input-port guarantee-output-port + guarantee-port guarantee-port-type i/o-port-type? i/o-port? @@ -1060,6 +1066,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. input-port/state input-port? interaction-i/o-port + make-encapsulated-port make-i/o-port make-i/o-port-type make-input-port @@ -1103,6 +1110,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. port? set-current-input-port! set-current-output-port! + set-encapsulated-port/state! set-input-port/state! set-interaction-i/o-port! set-notification-output-port! @@ -1177,6 +1185,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. newline output-port/discretionary-flush output-port/flush-output + output-port/fresh-line output-port/write-char output-port/write-object output-port/write-string diff --git a/v7/src/runtime/version.scm b/v7/src/runtime/version.scm index 1814e4af9..ec07cf609 100644 --- a/v7/src/runtime/version.scm +++ b/v7/src/runtime/version.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: version.scm,v 14.178 1999/02/01 03:30:24 cph Exp $ +$Id: version.scm,v 14.179 1999/02/18 04:04:43 cph Exp $ Copyright (c) 1988-1999 Massachusetts Institute of Technology @@ -27,7 +27,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (define (initialize-package!) (snarf-microcode-version!) (add-event-receiver! event:after-restore snarf-microcode-version!) - (add-identification! "Runtime" 14 178)) + (add-identification! "Runtime" 14 179)) (define (snarf-microcode-version!) (add-identification! "Microcode" diff --git a/v8/src/runtime/runtime.pkg b/v8/src/runtime/runtime.pkg index 9642462cb..a80915e50 100644 --- a/v8/src/runtime/runtime.pkg +++ b/v8/src/runtime/runtime.pkg @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: runtime.pkg,v 14.319 1999/02/16 20:11:00 cph Exp $ +$Id: runtime.pkg,v 14.320 1999/02/18 04:01:31 cph Exp $ Copyright (c) 1988-1999 Massachusetts Institute of Technology @@ -825,8 +825,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (export () transcript-off transcript-on) - (export (runtime console-i/o-port) - transcript-port) + (export (runtime rep) + make-transcriptable-port) (initialization (initialize-package!))) (define-package (runtime format) @@ -914,7 +914,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. make-generic-input-port make-generic-output-port) (export (runtime console-i/o-port) - generic-i/o-type) + generic-i/o-type + operation/flush-output) (export (runtime file-i/o-port) generic-i/o-type generic-input-type @@ -1049,9 +1050,14 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. close-port current-input-port current-output-port + encapsulated-port/port + encapsulated-port/state + encapsulated-port? + guarantee-encapsulated-port guarantee-i/o-port guarantee-input-port guarantee-output-port + guarantee-port guarantee-port-type i/o-port-type? i/o-port? @@ -1064,6 +1070,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. input-port/state input-port? interaction-i/o-port + make-encapsulated-port make-i/o-port make-i/o-port-type make-input-port @@ -1107,6 +1114,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. port? set-current-input-port! set-current-output-port! + set-encapsulated-port/state! set-input-port/state! set-interaction-i/o-port! set-notification-output-port! @@ -1181,6 +1189,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. newline output-port/discretionary-flush output-port/flush-output + output-port/fresh-line output-port/write-char output-port/write-object output-port/write-string -- 2.25.1