Use new port types mechanism.
authorChris Hanson <org/chris-hanson/cph>
Tue, 16 Feb 1999 20:12:28 +0000 (20:12 +0000)
committerChris Hanson <org/chris-hanson/cph>
Tue, 16 Feb 1999 20:12:28 +0000 (20:12 +0000)
15 files changed:
v7/src/edwin/artdebug.scm
v7/src/edwin/bufinp.scm
v7/src/edwin/bufout.scm
v7/src/edwin/debug.scm
v7/src/edwin/intmod.scm
v7/src/edwin/winout.scm
v7/src/runtime/emacs.scm
v7/src/runtime/fileio.scm
v7/src/runtime/genio.scm
v7/src/runtime/runtime.pkg
v7/src/runtime/strnin.scm
v7/src/runtime/strott.scm
v7/src/runtime/strout.scm
v7/src/runtime/ttyio.scm
v8/src/runtime/runtime.pkg

index 80d488d4259a9512d052f93ee2f564f4443e8870..055cf4a55ccbb67a7e19f47641294f9a2bcc64d7 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;; $Id: artdebug.scm,v 1.26 1999/01/02 06:11:34 cph Exp $
+;;; $Id: artdebug.scm,v 1.27 1999/02/16 20:12:15 cph Exp $
 ;;;
 ;;; Copyright (c) 1989-1999 Massachusetts Institute of Technology
 ;;;
@@ -87,13 +87,13 @@ and contract subproblems and reductions.
 (define-variable debugger-confirm-return?
   "True means to prompt for confirmation in RETURN-FROM and RETURN-TO
 commands before returning the value."
-  true
+  #t
   boolean?)
 
 (define-variable debugger-split-window?
   "True means use another window for the debugger buffer; false means
 use the current window."
-  true
+  #t
   boolean?)
 
 (define-variable debugger-one-at-a-time?
@@ -114,28 +114,28 @@ each time."
 
 (define-variable debugger-quit-on-return?
   "True means quit debugger when executing a \"return\" command."
-  true
+  #t
   boolean?)
 
 (define-variable debugger-quit-on-restart?
   "True means quit debugger when executing a \"restart\" command."
-  true
+  #t
   boolean?)
 
 (define-variable debugger-open-markers?
   "True means newlines are inserted between marker lines."
-  true
+  #t
   boolean?)
 
 (define-variable debugger-verbose-mode?
   "True means display extra information without the user requesting it."
-  false
+  #f
   boolean?)
 
 (define-variable debugger-expand-reductions?
   "True says to insert reductions when reduction motion commands are used
 in a subproblem whose reductions aren't already inserted."
-  true
+  #t
   boolean?)
 
 (define-variable debugger-max-subproblems
@@ -149,21 +149,21 @@ or #F meaning no limit."
 
 (define-variable debugger-hide-system-code?
   "True means don't show subproblems created by the runtime system."
-  true
+  #t
   boolean?)
 
 (define-variable debugger-show-help-message?
   "True means show a help message in the debugger buffer."
-  true
+  #t
   boolean?)
 
 (define-variable debugger-debug-evaluations?
   "True means evaluation errors in a debugger buffer start new debuggers."
-  false
+  #f
   boolean?)
 \f
-(define in-debugger? false)
-(define in-debugger-evaluation? false)
+(define in-debugger? #f)
+(define in-debugger-evaluation? #f)
 
 (define (maybe-debug-scheme-error switch-variable condition error-type-name)
   (if (variable-value switch-variable)
@@ -177,7 +177,7 @@ or #F meaning no limit."
                  (ref-variable debugger-start-on-error?))
              (or (not (eq? (ref-variable debugger-start-on-error?) 'ASK))
                  (debug-scheme-error? condition error-type-name)))
-        (fluid-let ((in-debugger? true))
+        (fluid-let ((in-debugger? #t))
           ((if (ref-variable debugger-split-window?)
                select-buffer-other-window
                select-buffer)
@@ -213,7 +213,7 @@ or #F meaning no limit."
     (if (and (not (null? buffers))
             (null? (cdr buffers))
             (ref-variable debugger-one-at-a-time?)
-            (or (eq? true (ref-variable debugger-one-at-a-time?))
+            (or (eq? #t (ref-variable debugger-one-at-a-time?))
                 (prompt-for-confirmation?
                  "Another debugger buffer exists.  Delete it")))
        (kill-buffer (car buffers))))
@@ -391,7 +391,7 @@ Use \\[kill-buffer] to quit the debugger."
   (let ((point (mark-left-inserting-copy (current-point))))
     (insert-string output point)
     (guarantee-newlines 1 point)
-    (insert-string (transcript-value-prefix-string value true) point)
+    (insert-string (transcript-value-prefix-string value #t) point)
     (insert-string (transcript-value-string value) point)
     (insert-newlines 2 point)
     (mark-temporary! point)))
@@ -482,7 +482,7 @@ Use \\[kill-buffer] to quit the debugger."
   (lambda (region)
     (let ((environment
           (dstate-evaluation-environment (start-evaluation region))))
-      (fluid-let ((in-debugger-evaluation? true))
+      (fluid-let ((in-debugger-evaluation? #t))
        (evaluate-region region environment)))))
 
 (define (start-evaluation region)
@@ -518,7 +518,7 @@ The evaluation occurs in the dynamic state of the current frame."
             (stack-frame->continuation (dstate/subproblem dstate)))
            (repl-eval hook/repl-eval))
        (fluid-let
-           ((in-debugger-evaluation? true)
+           ((in-debugger-evaluation? #t)
             (hook/repl-eval
              (lambda (expression environment syntax-table)
                (let ((unique (cons 'unique 'id)))
@@ -662,7 +662,7 @@ Move to the last subproblem if the subproblem number is too high."
                  (write-string string port)))
               (pp (lambda (obj)
                     (fresh-line port)
-                    (pretty-print obj port true)
+                    (pretty-print obj port #t)
                     (newline port))))
                     
           (if (dstate/reduction-number dstate)
@@ -683,10 +683,10 @@ Move to the last subproblem if the subproblem number is too high."
                        (if (or argument
                                (invalid-subexpression? sub))
                            (pp exp)
-                           (fluid-let ((*pp-no-highlights?* false))
+                           (fluid-let ((*pp-no-highlights?* #f))
                              (do-hairy))))
                       ((debugging-info/noise? exp)
-                       (message ((debugging-info/noise exp) true)))
+                       (message ((debugging-info/noise exp) #t)))
                       (else
                        (message "Unknown expression")))))))))))
 
@@ -899,7 +899,7 @@ Prefix argument means do not kill the debugger buffer."
                     (lambda (continuation arguments)
                       (invoke-continuation continuation
                                            arguments
-                                           false))))
+                                           #f))))
          (invoke-restart restart)))))
 \f
 ;;;; Marker Generation
@@ -1009,14 +1009,14 @@ Prefix argument means do not kill the debugger buffer."
               ((not (debugging-info/undefined-expression? expression))
                (print-with-subexpression expression subexpression))
               ((debugging-info/noise? expression)
-               (write-string ((debugging-info/noise expression) false)))
+               (write-string ((debugging-info/noise expression) #f)))
               (else
                (write-string ";undefined expression"))))
        environment
        port))))
 
 (define (print-with-subexpression expression subexpression)
-  (fluid-let ((*unparse-primitives-by-name?* true))
+  (fluid-let ((*unparse-primitives-by-name?* #t))
     (if (invalid-subexpression? subexpression)
        (write (unsyntax expression))
        (let ((sub (write-to-string (unsyntax subexpression))))
@@ -1036,7 +1036,7 @@ Prefix argument means do not kill the debugger buffer."
 
 (define (print-reduction subproblem-number reduction-number reduction port)
   (print-history-level
-   false
+   #f
    subproblem-number
    (string-append ", R=" (number->string reduction-number) " --- ")
    (lambda ()
@@ -1045,7 +1045,7 @@ Prefix argument means do not kill the debugger buffer."
    port))
 
 (define (print-reduction-as-subexpression expression)
-  (fluid-let ((*unparse-primitives-by-name?* true))
+  (fluid-let ((*unparse-primitives-by-name?* #t))
     (write-string (ref-variable subexpression-start-marker))
     (write (unsyntax expression))
     (write-string (ref-variable subexpression-end-marker))))
@@ -1226,7 +1226,7 @@ Prefix argument means do not kill the debugger buffer."
                 (if (and reduction-number
                          (positive? (dstate/number-of-reductions dstate)))
                     (change-reduction! dstate reduction-number)
-                    (set-dstate/reduction-number! dstate false))
+                    (set-dstate/reduction-number! dstate #f))
                 dstate)
          (editor-error "Cannot find environment for evaluation.")))))
 
@@ -1236,7 +1236,7 @@ Prefix argument means do not kill the debugger buffer."
           (if (and (dstate/using-history? dstate)
                    (positive? (dstate/number-of-reductions dstate)))
               (change-reduction! dstate 0)
-              (set-dstate/reduction-number! dstate false))))
+              (set-dstate/reduction-number! dstate #f))))
        (delta (- subproblem-number (dstate/subproblem-number dstate))))
     (if (negative? delta)
        (let ((subproblems
@@ -1299,7 +1299,7 @@ Prefix argument means do not kill the debugger buffer."
 
 (define (call-with-interface-port mark receiver)
   (let ((mark (mark-left-inserting-copy mark)))
-    (let ((value (receiver (port/copy interface-port-template mark))))
+    (let ((value (receiver (make-port interface-port-type mark))))
       (mark-temporary! mark)
       value)))
 
@@ -1332,7 +1332,7 @@ Prefix argument means do not kill the debugger buffer."
   (fresh-line port)
   (fluid-let ((debugger-pp
               (lambda (expression indentation port)
-                (pretty-print expression port true indentation))))
+                (pretty-print expression port #t indentation))))
     (thunk))
   (newline port)
   (newline port))
@@ -1345,8 +1345,8 @@ Prefix argument means do not kill the debugger buffer."
   port
   (prompt-for-confirmation? prompt))
 
-(define interface-port-template
-  (make-output-port
+(define interface-port-type
+  (make-output-port-type
    `((WRITE-CHAR ,operation/write-char)
      (WRITE-SUBSTRING ,operation/write-substring)
      (FRESH-LINE ,operation/fresh-line)
@@ -1356,4 +1356,4 @@ Prefix argument means do not kill the debugger buffer."
      (DEBUGGER-PRESENTATION ,debugger-presentation)
      (PROMPT-FOR-EXPRESSION ,operation/prompt-for-expression)
      (PROMPT-FOR-CONFIRMATION ,operation/prompt-for-confirmation))
-   false))
\ No newline at end of file
+   #f))
\ No newline at end of file
index ee0f6d04778fb4c2090df46d6a6d6530bbb83379..0772879b56a967b75faf3fd54f93760e0278b415 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;$Id: bufinp.scm,v 1.5 1999/01/02 06:11:34 cph Exp $
+;;;$Id: bufinp.scm,v 1.6 1999/02/16 20:12:24 cph Exp $
 ;;;
 ;;; Copyright (c) 1986, 1989-1999 Massachusetts Institute of Technology
 ;;;
 
 (define-structure (buffer-input-port-state
                   (conc-name buffer-input-port-state/))
-  (group false read-only true)
-  (end-index false read-only true)
-  (current-index false))
+  (group #f read-only #t)
+  (end-index #f read-only #t)
+  (current-index #f))
 
 (define (make-buffer-input-port mark end)
   ;; This uses indices, so it can only be used locally
   ;; where there is no buffer-modification happening.
-  (input-port/copy buffer-input-port-template
-                  (make-buffer-input-port-state (mark-group mark)
-                                                (mark-index end)
-                                                (mark-index mark))))
+  (make-port buffer-input-port-type
+            (make-buffer-input-port-state (mark-group mark)
+                                          (mark-index end)
+                                          (mark-index mark))))
 
 (define (operation/char-ready? port interval)
   interval                             ;ignore
      (make-mark (buffer-input-port-state/group state)
                (buffer-input-port-state/current-index state)))))
 
-(define buffer-input-port-template
-  (make-input-port `((CHAR-READY? ,operation/char-ready?)
-                    (DISCARD-CHAR ,operation/discard-char)
-                    (DISCARD-CHARS ,operation/discard-chars)
-                    (PEEK-CHAR ,operation/peek-char)
-                    (PRINT-SELF ,operation/print-self)
-                    (READ-CHAR ,operation/read-char)
-                    (READ-STRING ,operation/read-string))
-                  false))
\ No newline at end of file
+(define buffer-input-port-type
+  (make-input-port-type `((CHAR-READY? ,operation/char-ready?)
+                         (DISCARD-CHAR ,operation/discard-char)
+                         (DISCARD-CHARS ,operation/discard-chars)
+                         (PEEK-CHAR ,operation/peek-char)
+                         (PRINT-SELF ,operation/print-self)
+                         (READ-CHAR ,operation/read-char)
+                         (READ-STRING ,operation/read-string))
+                       #f))
\ No newline at end of file
index d2be70c2c9fc6740eeffd76186ff7b3e30ed19ec..f4736e14f5227c208e8f4feb00cdcf3ac27ec0e5 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;; $Id: bufout.scm,v 1.11 1999/01/02 06:11:34 cph Exp $
+;;; $Id: bufout.scm,v 1.12 1999/02/16 20:12:28 cph Exp $
 ;;;
 ;;; Copyright (c) 1986, 1989-1999 Massachusetts Institute of Technology
 ;;;
       value)))
 
 (define (mark->output-port mark #!optional buffer)
-  (output-port/copy mark-output-port-template
-                   (cons (mark-left-inserting-copy mark)
-                         (if (default-object? buffer)
-                             false
-                             buffer))))
+  (make-port mark-output-port-type
+            (cons (mark-left-inserting-copy mark)
+                  (if (default-object? buffer)
+                      #f
+                      buffer))))
 
 (define (output-port->mark port)
   (mark-temporary-copy (port/mark port)))
@@ -57,9 +57,9 @@
        (for-each (if (mark= mark (buffer-point buffer))
                      (lambda (window)
                        (set-window-point! window mark)
-                       (window-direct-update! window false))
+                       (window-direct-update! window #f))
                      (lambda (window)
-                       (window-direct-update! window false)))
+                       (window-direct-update! window #f)))
                  (buffer-windows buffer)))))
 
 (define (operation/fresh-line port)
 (define (operation/x-size port)
   (mark-x-size (port/mark port)))
 
-(define mark-output-port-template
-  (make-output-port `((CLOSE ,operation/close)
-                     (FLUSH-OUTPUT ,operation/flush-output)
-                     (FRESH-LINE ,operation/fresh-line)
-                     (PRINT-SELF ,operation/print-self)
-                     (WRITE-CHAR ,operation/write-char)
-                     (WRITE-SUBSTRING ,operation/write-substring)
-                     (X-SIZE ,operation/x-size))
-                   false))
\ No newline at end of file
+(define mark-output-port-type
+  (make-output-port-type `((CLOSE ,operation/close)
+                          (FLUSH-OUTPUT ,operation/flush-output)
+                          (FRESH-LINE ,operation/fresh-line)
+                          (PRINT-SELF ,operation/print-self)
+                          (WRITE-CHAR ,operation/write-char)
+                          (WRITE-SUBSTRING ,operation/write-substring)
+                          (X-SIZE ,operation/x-size))
+                        #f))
\ No newline at end of file
index 21f13adb5b4f699b70ccd34e44c74715954efd64..0e6511e4c788fdbda6b37a34dc48836a50c426e9 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;; $Id: debug.scm,v 1.46 1999/02/03 06:12:57 cph Exp $
+;;; $Id: debug.scm,v 1.47 1999/02/16 20:12:04 cph Exp $
 ;;;
 ;;; Copyright (c) 1992-1999 Massachusetts Institute of Technology
 ;;;
                            object
                            name
                            (vector)
-                           false
+                           #f
                            '()
                            (make-1d-table))))
          (buffer-put! buffer 'BROWSER browser)
                     (string-append
                      (if (1d-table/get (browser/properties browser)
                                        'VISIBLE-SUB-BUFFERS?
-                                       false)
+                                       #f)
                          ""
                          " ")
                      prefix
                                   (loop index (- argument 1))
                                   (begin
                                     (select-bline bline)
-                                    false))))
+                                    #f))))
                            (else
                             (let ((index (- index 1)))
                               (if (<= 0 index)
                                   (loop index (+ argument 1))
                                   (begin
                                     (select-bline bline)
-                                    false)))))))))
+                                    #f)))))))))
              (let ((point (current-point)))
                (let ((index (mark->bline-index point)))
                  (cond (index
                         (loop index argument))
                        ((= argument 0)
-                        false)
+                        #f)
                        (else
                         (let ((n (if (< argument 0) -1 1)))
                           (let find-next ((mark point))
-                            (let ((mark (line-start mark n false)))
+                            (let ((mark (line-start mark n #f)))
                               (and mark
                                    (let ((index (mark->bline-index mark)))
                                      (if index
        (set-buffer-point! (mark-buffer mark) mark)))
     (let ((buffer (bline/description-buffer bline)))
       (if buffer
-         (pop-up-buffer buffer false)))))
+         (pop-up-buffer buffer #f)))))
 
 (define (highlight-the-number mark)
   (let ((end (re-search-forward "[RSE][0-9]+ " mark (line-end mark 0))))
          (and (subproblem? (bline/object bline))
               (system-frame? (subproblem/stack-frame (bline/object bline)))))
         (buffer
-         (1d-table/get (bline/properties bline) 'DESCRIPTION-BUFFER false))
+         (1d-table/get (bline/properties bline) 'DESCRIPTION-BUFFER #f))
         (get-environment
          (1d-table/get (bline-type/properties (bline/type bline))
                        'GET-ENVIRONMENT
-                       false))
+                       #f))
         (env-exists? (if (and get-environment (not system?))
                          (let ((environment* (get-environment bline)))
                            (environment? environment*))
               (bline-type/write-description (bline/type bline))))
          (temporary-message "Computing, please wait...")
          (and write-description
-              (let ((buffer (browser/new-buffer (bline/browser bline) false)))
+              (let ((buffer (browser/new-buffer (bline/browser bline) #f)))
                 (call-with-output-mark (buffer-start buffer)
                   (lambda (port)
                     (write-description bline port)
           (bline (mark->bline mark))
           (browser (bline/browser bline))
           (buffer
-           (1d-table/get (bline/properties bline) 'DESCRIPTION-BUFFER false))
+           (1d-table/get (bline/properties bline) 'DESCRIPTION-BUFFER #f))
           (condition
            (browser/object browser)))
       (if (condition? condition)
 ;;;stuff gets called with uses the minibuffer for prompts
 (define (call-with-interface-port mark receiver)
   (let ((mark (mark-left-inserting-copy mark)))
-    (let ((value (receiver (port/copy interface-port-template mark))))
+    (let ((value (receiver (make-port interface-port-type mark))))
       (mark-temporary! mark)
       value)))
 
            (environment-browser-buffer environment))))))
 
 (define (bline/attached-buffer bline type make-buffer)
-  (let ((buffer (1d-table/get (bline/properties bline) type false)))
+  (let ((buffer (1d-table/get (bline/properties bline) type #f)))
     (if (and buffer (buffer-alive? buffer))
        buffer
        (let ((buffer (make-buffer)))
   (let ((get-environment
         (1d-table/get (bline-type/properties (bline/type bline))
                       'GET-ENVIRONMENT
-                      false))
+                      #f))
        (lose
         (lambda () (editor-error "The selected line has no environment."))))
     (if get-environment
        (set-bline/next! (record-modifier bline-rtd 'NEXT)))
     (lambda (object type parent prev)
       (let ((bline
-            (constructor false object type
+            (constructor #f object type
                          parent (if parent (+ (bline/depth parent) 1) 0)
-                         false prev (if prev (+ (bline/offset prev) 1) 0)
+                         #f prev (if prev (+ (bline/offset prev) 1) 0)
                          (make-1d-table))))
        (if prev
            (set-bline/next! prev bline))
                         (insert-newline mark)
                         (set-bline/start-mark!
                          bline
-                         (make-permanent-mark (mark-group mark) index true))))
+                         (make-permanent-mark (mark-group mark) index #t))))
                     blines)
                    (mark-temporary! mark)))))
            (set-browser/lines! browser bv*))))))
   (write-string "--more--" port))
 
 (define bline-type:continuation-line
-  (make-bline-type continuation-line/write-summary false 0))
+  (make-bline-type continuation-line/write-summary #f 0))
 
 (define (bline/continuation? bline)
   (eq? (bline/type bline) bline-type:continuation-line))
@@ -850,19 +850,19 @@ Set this variable to #F to disable this limit."
 (define-variable debugger-confirm-return?
   "True means prompt for confirmation in \"return\" commands.
 The prompting occurs prior to returning the value."
-  true
+  #t
   boolean?)
 
 (define-variable debugger-quit-on-return?
   "True means quit debugger when executing a \"return\" command.
 Quitting the debugger kills the debugger buffer and any associated buffers."
-  true
+  #t
   boolean?)
 
 (define-variable debugger-quit-on-restart?
   "True means quit debugger when executing a \"restart\" command.
 Quitting the debugger kills the debugger buffer and any associated buffers."
-  true
+  #t
   boolean?)
 
 ;;;Limited this bc the bindings are now pretty-printed
@@ -1260,7 +1260,7 @@ it has been renamed, it will not be deleted automatically.")
 (define (continuation->blines continuation limit)
   (let ((beyond-system-code #f))
     (let loop ((frame (continuation/first-subproblem continuation))
-              (prev false)
+              (prev #f)
               (n 0))
       (if (not frame)
          '()
@@ -1272,7 +1272,7 @@ it has been renamed, it will not be deleted automatically.")
                 (walk-reductions
                  (lambda (bline reductions)
                    (cons bline
-                         (let loop ((reductions reductions) (prev false))
+                         (let loop ((reductions reductions) (prev #f))
                            (if (null? reductions)
                                (next-subproblem bline)
                                (let ((bline
@@ -1292,14 +1292,14 @@ it has been renamed, it will not be deleted automatically.")
                                (let ((bline
                                       (make-bline subproblem
                                                   bline-type:subproblem
-                                                  false
+                                                  #f
                                                   prev)))
                                  (cons bline
                                        (next-subproblem bline)))
                                (let ((bline
                                       (make-bline (car reductions)
                                                   bline-type:reduction
-                                                  false
+                                                  #f
                                                   prev)))
                                  (walk-reductions bline
                                                   (if (> n 0)
@@ -1308,7 +1308,7 @@ it has been renamed, it will not be deleted automatically.")
                          (walk-reductions
                           (make-bline subproblem
                                       bline-type:subproblem
-                                      false
+                                      #f
                                       prev)
                           (subproblem/reductions subproblem)))))))
            (cond ((and (not (ref-variable debugger-hide-system-code?))
@@ -1321,7 +1321,7 @@ it has been renamed, it will not be deleted automatically.")
                           (begin (set! beyond-system-code #t) #t)
                           #f)
                       beyond-system-code)
-                  (list (make-continuation-bline continue false prev)))
+                  (list (make-continuation-bline continue #f prev)))
                  (else (continue))))))))
 \f
 (define subproblem-rtd
@@ -1387,14 +1387,14 @@ it has been renamed, it will not be deleted automatically.")
            (cond ((debugging-info/compiled-code? expression)
                   (write-string ";unknown compiled code" port))
                  ((not (debugging-info/undefined-expression? expression))
-                  (fluid-let ((*unparse-primitives-by-name?* true))
+                  (fluid-let ((*unparse-primitives-by-name?* #t))
                     (write
                      (unsyntax (if (invalid-subexpression? subexpression)
                                    expression
                                    subexpression)))))
                  ((debugging-info/noise? expression)
                   (write-string ";" port)
-                  (write-string ((debugging-info/noise expression) false)
+                  (write-string ((debugging-info/noise expression) #f)
                                 port))
                  (else
                   (write-string ";undefined expression" port))))))))
@@ -1434,7 +1434,7 @@ it has been renamed, it will not be deleted automatically.")
                           expression-indentation
                           port))))
                   ((debugging-info/noise? expression)
-                   (write-string ((debugging-info/noise expression) true)
+                   (write-string ((debugging-info/noise expression) #t)
                                  port))
                   (else
                    (write-string (if (stack-frame/compiled-code? frame)
@@ -1477,7 +1477,7 @@ it has been renamed, it will not be deleted automatically.")
            (subproblem/number (reduction/subproblem reduction)))
           port)))
     (write-string " " port)
-    (fluid-let ((*unparse-primitives-by-name?* true))
+    (fluid-let ((*unparse-primitives-by-name?* #t))
       (write (unsyntax (reduction/expression reduction)) port))))
 
 (define (reduction/write-description bline port)
@@ -1541,10 +1541,10 @@ it has been renamed, it will not be deleted automatically.")
        buffer))))
 
 (define (environment->blines environment)
-  (let loop ((environment environment) (prev false))
-    (let ((bline (make-bline environment bline-type:environment false prev)))
+  (let loop ((environment environment) (prev #f))
+    (let ((bline (make-bline environment bline-type:environment #f prev)))
       (cons bline
-           (if (eq? true (environment-has-parent? environment))
+           (if (eq? #t (environment-has-parent? environment))
                (loop (environment-parent environment) bline)
                '())))))
 \f
@@ -1653,7 +1653,7 @@ once it has been renamed, it will not be deleted automatically.")
                                (write limit port)
                                (write-string " shown):" port)
                                (finish (list-head names limit))
-                               true)))))))
+                               #t)))))))
          (else
           (write-string "  BINDINGS:" port)
           (finish
@@ -1894,9 +1894,9 @@ once it has been renamed, it will not be deleted automatically.")
   port
   (prompt-for-expression prompt))
 
-(define interface-port-template
-  (make-output-port
+(define interface-port-type
+  (make-output-port-type
    `((WRITE-CHAR ,operation/write-char)
      (PROMPT-FOR-CONFIRMATION ,operation/prompt-for-confirmation)
      (PROMPT-FOR-EXPRESSION ,operation/prompt-for-expression))
-   false))
\ No newline at end of file
+   #f))
\ No newline at end of file
index 8eb505320c6d5d0aa7fd7c9b551a2fb152f3866c..b04c4b4ae6ef13a6bd663f94fb9afa33c1bc448d 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;; $Id: intmod.scm,v 1.95 1999/01/02 06:11:34 cph Exp $
+;;; $Id: intmod.scm,v 1.96 1999/02/16 20:12:20 cph Exp $
 ;;;
 ;;; Copyright (c) 1986, 1989-1999 Massachusetts Institute of Technology
 ;;;
@@ -708,7 +708,7 @@ If this is an error, the debugger examines the error condition."
 (define (make-interface-port buffer thread)
   (letrec
       ((port
-       (port/copy interface-port-template
+       (make-port interface-port-type
                   (make-interface-port-state
                    thread
                    (mark-right-inserting-copy (buffer-end buffer))
@@ -1052,8 +1052,8 @@ If this is an error, the debugger examines the error condition."
            syntax-table))
       #t)))
 
-(define interface-port-template
-  (make-i/o-port
+(define interface-port-type
+  (make-i/o-port-type
    `((WRITE-CHAR ,operation/write-char)
      (WRITE-SUBSTRING ,operation/write-substring)
      (FRESH-LINE ,operation/fresh-line)
index 8035df8947418de6db23de5dd0c49caae660b6c3..ae561be000074e286e0b896743fbab5b17ec0fad 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;$Id: winout.scm,v 1.11 1999/02/16 00:44:11 cph Exp $
+;;;$Id: winout.scm,v 1.12 1999/02/16 20:12:09 cph Exp $
 ;;;
 ;;; Copyright (c) 1986, 1989-1999 Massachusetts Institute of Technology
 ;;;
@@ -30,7 +30,7 @@
   (with-output-to-port (window-output-port window) thunk))
 
 (define (window-output-port window)
-  (output-port/copy window-output-port-template window))
+  (make-port window-output-port-type window))
 
 (define (operation/fresh-line port)
   (if (not (line-start? (window-point (port/state port))))
@@ -44,7 +44,7 @@
               (line-end? point)
               (buffer-auto-save-modified? buffer)
               (or (not (window-needs-redisplay? window))
-                  (window-direct-update! window false)))
+                  (window-direct-update! window #f)))
          (cond ((and (group-end? point)
                      (char=? char #\newline)
                      (< (1+ (window-point-y window)) (window-y-size window)))
@@ -69,7 +69,7 @@
               (line-end? point)
               (buffer-auto-save-modified? buffer)
               (or (not (window-needs-redisplay? window))
-                  (window-direct-update! window false))
+                  (window-direct-update! window #f))
               (let loop ((i (- end 1)))
                 (or (< i start)
                     (let ((char (string-ref string i)))
@@ -87,7 +87,7 @@
 (define (operation/flush-output port)
   (let ((window (port/state port)))
     (if (window-needs-redisplay? window)
-       (window-direct-update! window false))))
+       (window-direct-update! window #f))))
 
 (define (operation/x-size port)
   (window-x-size (port/state port)))
   (unparse-string state "to window ")
   (unparse-object state (port/state port)))
 
-(define window-output-port-template
-  (make-output-port `((FLUSH-OUTPUT ,operation/flush-output)
-                     (FRESH-LINE ,operation/fresh-line)
-                     (PRINT-SELF ,operation/print-self)
-                     (WRITE-CHAR ,operation/write-char)
-                     (WRITE-SUBSTRING ,operation/write-substring)
-                     (X-SIZE ,operation/x-size))
-                   false))
\ No newline at end of file
+(define window-output-port-type
+  (make-output-port-type `((FLUSH-OUTPUT ,operation/flush-output)
+                          (FRESH-LINE ,operation/fresh-line)
+                          (PRINT-SELF ,operation/print-self)
+                          (WRITE-CHAR ,operation/write-char)
+                          (WRITE-SUBSTRING ,operation/write-substring)
+                          (X-SIZE ,operation/x-size))
+                        #f))
\ No newline at end of file
index 16f47c27c022538813e1e2a409d77be2c004741a..a53293a257ec61163c75bda15c2fd4c3c8683c5d 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: emacs.scm,v 14.23 1999/01/02 06:11:34 cph Exp $
+$Id: emacs.scm,v 14.24 1999/02/16 20:11:25 cph Exp $
 
 Copyright (c) 1988-1999 Massachusetts Institute of Technology
 
@@ -210,28 +210,22 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 (define (initialize-package!)
   (set! emacs-console-port
        (make-i/o-port
-        (let ((operations
-               `((PROMPT-FOR-EXPRESSION ,emacs/prompt-for-expression)
-                 (PROMPT-FOR-COMMAND-CHAR ,emacs/prompt-for-command-char)
-                 (PROMPT-FOR-COMMAND-EXPRESSION
-                  ,emacs/prompt-for-command-expression)
-                 (PROMPT-FOR-CONFIRMATION ,emacs/prompt-for-confirmation)
-                 (DEBUGGER-FAILURE ,emacs/debugger-failure)
-                 (DEBUGGER-MESSAGE ,emacs/debugger-message)
-                 (DEBUGGER-PRESENTATION ,emacs/debugger-presentation)
-                 (WRITE-RESULT ,emacs/write-result)
-                 (SET-DEFAULT-DIRECTORY ,emacs/set-default-directory)
-                 (READ-START ,emacs/read-start)
-                 (READ-FINISH ,emacs/read-finish)
-                 (GC-START ,emacs/gc-start)
-                 (GC-FINISH ,emacs/gc-finish))))
-          (append-map* operations
-                       (lambda (name)
-                         (if (assq name operations)
-                             '()
-                             `((,name
-                                ,(port/operation the-console-port name)))))
-                       (port/operation-names the-console-port)))
+        (make-i/o-port-type
+         `((PROMPT-FOR-EXPRESSION ,emacs/prompt-for-expression)
+           (PROMPT-FOR-COMMAND-CHAR ,emacs/prompt-for-command-char)
+           (PROMPT-FOR-COMMAND-EXPRESSION
+            ,emacs/prompt-for-command-expression)
+           (PROMPT-FOR-CONFIRMATION ,emacs/prompt-for-confirmation)
+           (DEBUGGER-FAILURE ,emacs/debugger-failure)
+           (DEBUGGER-MESSAGE ,emacs/debugger-message)
+           (DEBUGGER-PRESENTATION ,emacs/debugger-presentation)
+           (WRITE-RESULT ,emacs/write-result)
+           (SET-DEFAULT-DIRECTORY ,emacs/set-default-directory)
+           (READ-START ,emacs/read-start)
+           (READ-FINISH ,emacs/read-finish)
+           (GC-START ,emacs/gc-start)
+           (GC-FINISH ,emacs/gc-finish))
+         the-console-port-type)
         (port/state the-console-port)))
   ;; YUCCH!  Kludge to copy mutex of console port into emacs port.
   (set-port/thread-mutex! emacs-console-port
index c8080952b74121044b3dac21b364a9f2a8d801be..61738febd8384b75d15af9bbb257545747f7829e 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: fileio.scm,v 1.15 1999/02/16 05:39:07 cph Exp $
+$Id: fileio.scm,v 1.16 1999/02/16 20:11:34 cph Exp $
 
 Copyright (c) 1991-1999 Massachusetts Institute of Technology
 
@@ -26,65 +26,28 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 \f
 (define (initialize-package!)
   (let ((input-operations
-        `((BUFFERED-INPUT-CHARS ,operation/buffered-input-chars)
-          (CHAR-READY? ,operation/char-ready?)
-          (CHARS-REMAINING ,operation/chars-remaining)
-          (CLOSE-INPUT ,operation/close-input)
-          (DISCARD-CHAR ,operation/discard-char)
-          (DISCARD-CHARS ,operation/discard-chars)
-          (EOF? ,operation/eof?)
-          (INPUT-BLOCKING-MODE ,operation/input-blocking-mode)
-          (INPUT-BUFFER-SIZE ,operation/input-buffer-size)
-          (INPUT-CHANNEL ,operation/input-channel)
-          (INPUT-OPEN? ,operation/input-open?)
-          (INPUT-TERMINAL-MODE ,operation/input-terminal-mode)
-          (LENGTH ,operation/length)
-          (PEEK-CHAR ,operation/peek-char)
-          (READ-CHAR ,operation/read-char)
-          (READ-STRING ,operation/read-string)
-          (READ-SUBSTRING ,operation/read-substring)
-          (REST->STRING ,operation/rest->string)
-          (SET-INPUT-BLOCKING-MODE ,operation/set-input-blocking-mode)
-          (SET-INPUT-BUFFER-SIZE ,operation/set-input-buffer-size)
-          (SET-INPUT-TERMINAL-MODE ,operation/set-input-terminal-mode)))
-       (output-operations
-        `((BUFFERED-OUTPUT-CHARS ,operation/buffered-output-chars)
-          (CLOSE-OUTPUT ,operation/close-output)
-          (FLUSH-OUTPUT ,operation/flush-output)
-          (FRESH-LINE ,operation/fresh-line)
-          (OUTPUT-BLOCKING-MODE ,operation/output-blocking-mode)
-          (OUTPUT-BUFFER-SIZE ,operation/output-buffer-size)
-          (OUTPUT-CHANNEL ,operation/output-channel)
-          (OUTPUT-OPEN? ,operation/output-open?)
-          (OUTPUT-TERMINAL-MODE ,operation/output-terminal-mode)
-          (SET-OUTPUT-BLOCKING-MODE ,operation/set-output-blocking-mode)
-          (SET-OUTPUT-BUFFER-SIZE ,operation/set-output-buffer-size)
-          (SET-OUTPUT-TERMINAL-MODE ,operation/set-output-terminal-mode)
-          (WRITE-CHAR ,operation/write-char)
-          (WRITE-SUBSTRING ,operation/write-substring)))
+        `((LENGTH ,operation/length)
+          (REST->STRING ,operation/rest->string)))
        (other-operations
-        `((CLOSE ,operation/close)
+        `((WRITE-SELF ,operation/write-self)
           (PATHNAME ,operation/pathname)
-          (WRITE-SELF ,operation/write-self)
           (TRUENAME ,operation/truename))))
-    (set! input-file-template
-         (make-input-port (append input-operations
-                                  other-operations)
-                          #f))
-    (set! output-file-template
-         (make-output-port (append output-operations
-                                   other-operations)
-                           #f))
-    (set! i/o-file-template
-         (make-i/o-port (append input-operations
-                                output-operations
-                                other-operations)
-                        #f)))
+    (set! input-file-type
+         (make-input-port-type (append input-operations
+                                       other-operations)
+                               generic-input-type))
+    (set! output-file-type
+         (make-output-port-type other-operations
+                                generic-output-type))
+    (set! i/o-file-type
+         (make-i/o-port-type (append input-operations
+                                     other-operations)
+                             generic-i/o-type)))
   unspecific)
 
-(define input-file-template)
-(define output-file-template)
-(define i/o-file-template)
+(define input-file-type)
+(define output-file-type)
+(define i/o-file-type)
 
 (define input-buffer-size 512)
 (define output-buffer-size 512)
@@ -93,8 +56,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
   (let* ((pathname (merge-pathnames filename))
         (channel (file-open-input-channel (->namestring pathname)))
         (port
-         (port/copy
-          input-file-template
+         (make-port
+          input-file-type
           (make-file-state
            (make-input-buffer channel
                               input-buffer-size
@@ -112,8 +75,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
                (file-open-append-channel filename)
                (file-open-output-channel filename))))
         (port
-         (port/copy
-          output-file-template
+         (make-port
+          output-file-type
           (make-file-state
            #f
            (make-output-buffer channel
@@ -128,8 +91,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
         (channel (file-open-io-channel (->namestring pathname)))
         (translation (pathname-newline-translation pathname))
         (port
-         (port/copy
-          i/o-file-template
+         (make-port
+          i/o-file-type
           (make-file-state
            (make-input-buffer channel input-buffer-size translation)
            (make-output-buffer channel output-buffer-size translation)
@@ -146,7 +109,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
   (let* ((pathname (merge-pathnames filename))
         (channel (file-open-input-channel (->namestring pathname)))
         (port
-         (port/copy input-file-template
+         (make-port input-file-type
                     (make-file-state (make-input-buffer channel
                                                         input-buffer-size
                                                         #f)
@@ -163,7 +126,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
                (file-open-append-channel filename)
                (file-open-output-channel filename))))
         (port
-         (port/copy output-file-template
+         (make-port output-file-type
                     (make-file-state #f
                                      (make-output-buffer channel
                                                          output-buffer-size
@@ -176,7 +139,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
   (let* ((pathname (merge-pathnames filename))
         (channel (file-open-io-channel (->namestring pathname)))
         (port
-         (port/copy i/o-file-template
+         (make-port i/o-file-type
                     (make-file-state (make-input-buffer channel
                                                         input-buffer-size
                                                         #f)
@@ -236,7 +199,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
   (pathname #f read-only #t))
 
 (define (operation/length port)
-  (channel-file-length (operation/input-channel port)))
+  (channel-file-length (port/input-channel port)))
 
 (define (operation/pathname port)
   (file-state/pathname (port/state port)))
index 4ab4b0818dd28b1f63cd8aa9e09b1b9760696bc9..276d12c3052880535679688f70f4e1046d95ae6b 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: genio.scm,v 1.13 1999/02/16 05:38:34 cph Exp $
+$Id: genio.scm,v 1.14 1999/02/16 20:11:38 cph Exp $
 
 Copyright (c) 1991-1999 Massachusetts Institute of Technology
 
@@ -63,24 +63,24 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
        (other-operations
         `((CLOSE ,operation/close)
           (WRITE-SELF ,operation/write-self))))
-    (set! generic-input-template
-         (make-input-port (append input-operations
-                                  other-operations)
-                          #f))
-    (set! generic-output-template
-         (make-output-port (append output-operations
-                                   other-operations)
-                           #f))
-    (set! generic-i/o-template
-         (make-i/o-port (append input-operations
-                                output-operations
-                                other-operations)
-                        #f)))
+    (set! generic-input-type
+         (make-input-port-type (append input-operations
+                                       other-operations)
+                               #f))
+    (set! generic-output-type
+         (make-output-port-type (append output-operations
+                                        other-operations)
+                                #f))
+    (set! generic-i/o-type
+         (make-i/o-port-type (append input-operations
+                                     output-operations
+                                     other-operations)
+                             #f)))
   unspecific)
 
-(define generic-input-template)
-(define generic-output-template)
-(define generic-i/o-template)
+(define generic-input-type)
+(define generic-output-type)
+(define generic-i/o-type)
 \f
 (define (make-generic-input-port input-channel input-buffer-size
                                 #!optional line-translation)
@@ -88,7 +88,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
         (if (default-object? line-translation)
             'DEFAULT
             line-translation)))
-    (make-generic-port generic-input-template
+    (make-generic-port generic-input-type
                       (make-input-buffer input-channel
                                          input-buffer-size
                                          line-translation)
@@ -100,7 +100,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
         (if (default-object? line-translation)
             'DEFAULT
             line-translation)))
-    (make-generic-port generic-output-template
+    (make-generic-port generic-output-type
                       #f
                       (make-output-buffer output-channel
                                           output-buffer-size
@@ -118,7 +118,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
           (if (default-object? output-line-translation)
               input-line-translation
               output-line-translation)))
-      (make-generic-port generic-i/o-template
+      (make-generic-port generic-i/o-type
                         (make-input-buffer input-channel
                                            input-buffer-size
                                            input-line-translation)
@@ -126,8 +126,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
                                             output-buffer-size
                                             output-line-translation)))))
 
-(define (make-generic-port template input-buffer output-buffer)
-  (let ((port (port/copy template (vector input-buffer output-buffer))))
+(define (make-generic-port type input-buffer output-buffer)
+  (let ((port (make-port type (vector input-buffer output-buffer))))
     (if input-buffer
        (set-channel-port! (input-buffer/channel input-buffer) port))
     (if output-buffer
index ded79f0f575d2174d757b56d6945f2523fad9da0..af43cc64e162d94ebc710514117888c668353666 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: runtime.pkg,v 14.313 1999/02/16 19:49:07 cph Exp $
+$Id: runtime.pkg,v 14.314 1999/02/16 20:11:18 cph Exp $
 
 Copyright (c) 1988-1999 Massachusetts Institute of Technology
 
@@ -387,7 +387,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
          console-output-port
          set-console-i/o-port!)
   (export (runtime emacs-interface)
-         the-console-port)
+         the-console-port
+         the-console-port-type)
   (initialization (initialize-package!)))
 
 (define-package (runtime continuation)
@@ -909,60 +910,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
          make-generic-input-port
          make-generic-output-port)
   (export (runtime console-i/o-port)
-         operation/buffered-input-chars
-         operation/buffered-output-chars
-         operation/char-ready?
-         operation/input-blocking-mode
-         operation/input-buffer-size
-         operation/input-channel
-         operation/input-open?
-         operation/input-terminal-mode
-         operation/output-blocking-mode
-         operation/output-buffer-size
-         operation/output-channel
-         operation/output-open?
-         operation/output-terminal-mode
-         operation/set-input-blocking-mode
-         operation/set-input-buffer-size
-         operation/set-input-terminal-mode
-         operation/set-output-blocking-mode
-         operation/set-output-buffer-size
-         operation/set-output-terminal-mode)
+         generic-i/o-type)
   (export (runtime file-i/o-port)
-         operation/buffered-input-chars
-         operation/buffered-output-chars
-         operation/char-ready?
-         operation/chars-remaining
-         operation/close
-         operation/close-input
-         operation/close-output
-         operation/discard-char
-         operation/discard-chars
-         operation/eof?
-         operation/flush-output
-         operation/fresh-line
-         operation/input-blocking-mode
-         operation/input-buffer-size
-         operation/input-channel
-         operation/input-open?
-         operation/input-terminal-mode
-         operation/output-blocking-mode
-         operation/output-buffer-size
-         operation/output-channel
-         operation/output-open?
-         operation/output-terminal-mode
-         operation/peek-char
-         operation/read-char
-         operation/read-string
-         operation/read-substring
-         operation/set-input-blocking-mode
-         operation/set-input-buffer-size
-         operation/set-input-terminal-mode
-         operation/set-output-blocking-mode
-         operation/set-output-buffer-size
-         operation/set-output-terminal-mode
-         operation/write-char
-         operation/write-substring)
+         generic-i/o-type
+         generic-input-type
+         generic-output-type)
   (initialization (initialize-package!)))
 
 (define-package (runtime gensym)
index ecd6d4816847b0f96c7aabfe16bda5ff4c50c48b..acf10c63865efea7b5f248a5b572e48e9e8ad6ba 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: strnin.scm,v 14.5 1999/01/02 06:19:10 cph Exp $
+$Id: strnin.scm,v 14.6 1999/02/16 20:11:55 cph Exp $
 
 Copyright (c) 1988-1999 Massachusetts Institute of Technology
 
@@ -25,15 +25,16 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 (declare (usual-integrations))
 \f
 (define (initialize-package!)
-  (set! input-string-template
-       (make-input-port `((CHAR-READY? ,operation/char-ready?)
-                          (DISCARD-CHAR ,operation/discard-char)
-                          (DISCARD-CHARS ,operation/discard-chars)
-                          (PEEK-CHAR ,operation/peek-char)
-                          (WRITE-SELF ,operation/write-self)
-                          (READ-CHAR ,operation/read-char)
-                          (READ-STRING ,operation/read-string))
-                        false)))
+  (set! input-string-port-type
+       (make-input-port-type `((CHAR-READY? ,operation/char-ready?)
+                               (DISCARD-CHAR ,operation/discard-char)
+                               (DISCARD-CHARS ,operation/discard-chars)
+                               (PEEK-CHAR ,operation/peek-char)
+                               (WRITE-SELF ,operation/write-self)
+                               (READ-CHAR ,operation/read-char)
+                               (READ-STRING ,operation/read-string))
+                             #f))
+  unspecific)
 
 (define (with-input-from-string string thunk)
   (with-input-from-port (string->input-port string) thunk))
@@ -43,8 +44,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
         (if (default-object? end)
             (string-length string)
             (check-index end (string-length string) 'STRING->INPUT-PORT))))
-    (input-port/copy
-     input-string-template
+    (make-port
+     input-string-port-type
      (make-input-string-state string
                              (if (default-object? start)
                                  0
@@ -58,13 +59,13 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
       (error:bad-range-argument index procedure))
   index)
 
-(define input-string-template)
+(define input-string-port-type)
 
 (define-structure (input-string-state (type vector)
                                      (conc-name input-string-state/))
-  (string false read-only true)
+  (string #f read-only #t)
   start
-  (end false read-only true))
+  (end #f read-only #t))
 
 (define-integrable (input-port/string port)
   (input-string-state/string (input-port/state port)))
index 6176aa6e584fbe50f1550090016d0bc839c8f6ef..d2e2aedff02860fdcec736c8d0d6cb92f6065ebd 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: strott.scm,v 14.6 1999/02/16 00:53:21 cph Exp $
+$Id: strott.scm,v 14.7 1999/02/16 20:11:51 cph Exp $
 
 Copyright (c) 1988-1999 Massachusetts Institute of Technology
 
@@ -25,11 +25,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 (declare (usual-integrations))
 \f
 (define (initialize-package!)
-  (set! output-string-template
-       (make-output-port `((WRITE-SELF ,operation/write-self)
-                           (WRITE-CHAR ,operation/write-char)
-                           (WRITE-SUBSTRING ,operation/write-substring))
-                         #f)))
+  (set! output-string-port-type
+       (make-output-port-type `((WRITE-SELF ,operation/write-self)
+                                (WRITE-CHAR ,operation/write-char)
+                                (WRITE-SUBSTRING ,operation/write-substring))
+                              #f)))
 
 (define (with-output-to-truncated-string max thunk)
   (call-with-current-continuation
@@ -40,11 +40,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
                   (let ((state
                          (make-output-string-state return max '() max)))
                     (with-output-to-port
-                        (output-port/copy output-string-template state)
+                        (make-port output-string-port-type state)
                       thunk)
                     (output-string-state/accumulator state))))))))
 
-(define output-string-template)
+(define output-string-port-type)
 
 (define-structure (output-string-state (type vector)
                                       (conc-name output-string-state/))
index 8ec9f9c8bb840fd2c18452b0eb4014c9d5fbc9ac..a328611d8bc7607cc07f424cce4f78bacd41862b 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: strout.scm,v 14.9 1999/01/02 06:19:10 cph Exp $
+$Id: strout.scm,v 14.10 1999/02/16 20:11:47 cph Exp $
 
 Copyright (c) 1988-1999 Massachusetts Institute of Technology
 
@@ -25,11 +25,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 (declare (usual-integrations))
 \f
 (define (initialize-package!)
-  (set! output-string-template
-       (make-output-port `((WRITE-SELF ,operation/write-self)
-                           (WRITE-CHAR ,operation/write-char)
-                           (WRITE-SUBSTRING ,operation/write-substring))
-                         false))
+  (set! output-string-port-type
+       (make-output-port-type `((WRITE-SELF ,operation/write-self)
+                                (WRITE-CHAR ,operation/write-char)
+                                (WRITE-SUBSTRING ,operation/write-substring))
+                              #f))
   unspecific)
 
 (define (with-output-to-string thunk)
@@ -39,14 +39,14 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
 (define (with-string-output-port generator)
   (let ((state (make-output-string-state (make-string 16) 0)))
-    (let ((port (output-port/copy output-string-template state)))
+    (let ((port (make-port output-string-port-type state)))
       (generator port)
       (without-interrupts
        (lambda ()
         (string-head (output-string-state/accumulator state)
                      (output-string-state/counter state)))))))
 
-(define output-string-template)
+(define output-string-port-type)
 
 (define-structure (output-string-state (type vector)
                                       (conc-name output-string-state/))
index b2e7319256a62202d94dd5c748e9e5b29e912ce7..290e7404f0740e34b7a79b4202764235c17b7a41 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: ttyio.scm,v 1.9 1999/02/16 05:44:54 cph Exp $
+$Id: ttyio.scm,v 1.10 1999/02/16 20:11:30 cph Exp $
 
 Copyright (c) 1991-1999 Massachusetts Institute of Technology
 
@@ -32,45 +32,29 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
        (output-channel (tty-output-channel)))
     (set! hook/read-char operation/read-char)
     (set! hook/peek-char operation/peek-char)
-    (set! the-console-port
-         (make-i/o-port
+    (set! the-console-port-type
+         (make-i/o-port-type
           `((BEEP ,operation/beep)
-            (BUFFERED-INPUT-CHARS ,operation/buffered-input-chars)
-            (BUFFERED-OUTPUT-CHARS ,operation/buffered-output-chars)
-            (CHAR-READY? ,operation/char-ready?)
             (CLEAR ,operation/clear)
-            (DISCARD-CHAR ,operation/read-char)
-            (DISCRETIONARY-FLUSH-OUTPUT ,operation/discretionary-flush-output)
+            (DISCRETIONARY-FLUSH-OUTPUT
+             ,operation/discretionary-flush-output)
             (FLUSH-OUTPUT ,operation/flush-output)
             (FRESH-LINE ,operation/fresh-line)
-            (INPUT-BLOCKING-MODE ,operation/input-blocking-mode)
-            (INPUT-BUFFER-SIZE ,operation/input-buffer-size)
-            (INPUT-CHANNEL ,operation/input-channel)
-            (INPUT-OPEN? ,operation/input-open?)
-            (INPUT-TERMINAL-MODE ,operation/input-terminal-mode)
-            (OUTPUT-BLOCKING-MODE ,operation/output-blocking-mode)
-            (OUTPUT-BUFFER-SIZE ,operation/output-buffer-size)
-            (OUTPUT-CHANNEL ,operation/output-channel)
-            (OUTPUT-OPEN? ,operation/output-open?)
-            (OUTPUT-TERMINAL-MODE ,operation/output-terminal-mode)
             (PEEK-CHAR ,(lambda (port) (hook/peek-char port)))
-            (WRITE-SELF ,operation/write-self)
             (READ-CHAR ,(lambda (port) (hook/read-char port)))
             (READ-FINISH ,operation/read-finish)
-            (SET-INPUT-BLOCKING-MODE ,operation/set-input-blocking-mode)
-            (SET-INPUT-BUFFER-SIZE ,operation/set-input-buffer-size)
-            (SET-INPUT-TERMINAL-MODE ,operation/set-input-terminal-mode)
-            (SET-OUTPUT-BLOCKING-MODE ,operation/set-output-blocking-mode)
-            (SET-OUTPUT-BUFFER-SIZE ,operation/set-output-buffer-size)
-            (SET-OUTPUT-TERMINAL-MODE ,operation/set-output-terminal-mode)
             (WRITE-CHAR ,operation/write-char)
+            (WRITE-SELF ,operation/write-self)
             (WRITE-SUBSTRING ,operation/write-substring)
             (X-SIZE ,operation/x-size)
             (Y-SIZE ,operation/y-size))
-          (make-console-port-state
-           (make-input-buffer input-channel input-buffer-size)
-           (make-output-buffer output-channel output-buffer-size)
-           (channel-type=file? input-channel))))
+          generic-i/o-type))
+    (set! the-console-port
+         (make-port the-console-port-type
+                    (make-console-port-state
+                     (make-input-buffer input-channel input-buffer-size)
+                     (make-output-buffer output-channel output-buffer-size)
+                     (channel-type=file? input-channel))))
     (set-channel-port! input-channel the-console-port)
     (set-channel-port! output-channel the-console-port))
   (add-event-receiver! event:before-exit save-console-input)
@@ -79,6 +63,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
   (set-current-input-port! the-console-port)
   (set-current-output-port! the-console-port))
 
+(define the-console-port-type)
 (define the-console-port)
 (define input-buffer-size 512)
 (define output-buffer-size 512)
index 1bf746ad62e654b7fa906cb7e19f6fd371948374..9642462cb42c54996e3936ea061bc3ff0c250350 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: runtime.pkg,v 14.318 1999/02/16 19:49:13 cph Exp $
+$Id: runtime.pkg,v 14.319 1999/02/16 20:11:00 cph Exp $
 
 Copyright (c) 1988-1999 Massachusetts Institute of Technology
 
@@ -386,7 +386,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
          console-output-port
          set-console-i/o-port!)
   (export (runtime emacs-interface)
-         the-console-port)
+         the-console-port
+         the-console-port-type)
   (initialization (initialize-package!)))
 
 (define-package (runtime continuation)
@@ -913,60 +914,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
          make-generic-input-port
          make-generic-output-port)
   (export (runtime console-i/o-port)
-         operation/buffered-input-chars
-         operation/buffered-output-chars
-         operation/char-ready?
-         operation/input-blocking-mode
-         operation/input-buffer-size
-         operation/input-channel
-         operation/input-open?
-         operation/input-terminal-mode
-         operation/output-blocking-mode
-         operation/output-buffer-size
-         operation/output-channel
-         operation/output-open?
-         operation/output-terminal-mode
-         operation/set-input-blocking-mode
-         operation/set-input-buffer-size
-         operation/set-input-terminal-mode
-         operation/set-output-blocking-mode
-         operation/set-output-buffer-size
-         operation/set-output-terminal-mode)
+         generic-i/o-type)
   (export (runtime file-i/o-port)
-         operation/buffered-input-chars
-         operation/buffered-output-chars
-         operation/char-ready?
-         operation/chars-remaining
-         operation/close
-         operation/close-input
-         operation/close-output
-         operation/discard-char
-         operation/discard-chars
-         operation/eof?
-         operation/flush-output
-         operation/fresh-line
-         operation/input-blocking-mode
-         operation/input-buffer-size
-         operation/input-channel
-         operation/input-open?
-         operation/input-terminal-mode
-         operation/output-blocking-mode
-         operation/output-buffer-size
-         operation/output-channel
-         operation/output-open?
-         operation/output-terminal-mode
-         operation/peek-char
-         operation/read-char
-         operation/read-string
-         operation/read-substring
-         operation/set-input-blocking-mode
-         operation/set-input-buffer-size
-         operation/set-input-terminal-mode
-         operation/set-output-blocking-mode
-         operation/set-output-buffer-size
-         operation/set-output-terminal-mode
-         operation/write-char
-         operation/write-substring)
+         generic-i/o-type
+         generic-input-type
+         generic-output-type)
   (initialization (initialize-package!)))
 
 (define-package (runtime gensym)