Change the names of the `standard-repl-{environment,syntax-table}'
authorChris Hanson <org/chris-hanson/cph>
Thu, 14 Jul 1988 07:41:03 +0000 (07:41 +0000)
committerChris Hanson <org/chris-hanson/cph>
Thu, 14 Jul 1988 07:41:03 +0000 (07:41 +0000)
operations to `nearest-repl/{environment,syntax-table}'.  Add new
operations `{input,output}-port/operation'.

12 files changed:
v7/src/runtime/debug.scm
v7/src/runtime/error.scm
v7/src/runtime/input.scm
v7/src/runtime/load.scm
v7/src/runtime/output.scm
v7/src/runtime/packag.scm
v7/src/runtime/rep.scm
v7/src/runtime/runtime.pkg
v7/src/runtime/version.scm
v7/src/runtime/where.scm
v8/src/runtime/load.scm
v8/src/runtime/runtime.pkg

index 54772b6e87fb2ae548f7038a861530aebe6fa952..0c3359366ad3a6548a577e04b4af8dc3bb029d47 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/debug.scm,v 14.2 1988/06/21 05:48:48 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/debug.scm,v 14.3 1988/07/14 07:39:50 cph Exp $
 
 Copyright (c) 1988 Massachusetts Institute of Technology
 
@@ -532,7 +532,7 @@ MIT in each case. |#
        (print-undefined-environment)
        (newline)
        (write-string "Using the read-eval-print environment instead!")
-       (receiver (standard-repl-environment)))
+       (receiver (nearest-repl/environment)))
       (receiver environment)))
 
 (define (if-valid-environment environment receiver)
index 9010d6625ce8c5a9d2d62cfcc6bbf156ca30498e..7157632b98546a9eb0c5920367f580a867105e83 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/error.scm,v 14.3 1988/06/21 05:53:08 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/error.scm,v 14.4 1988/07/14 07:40:00 cph Exp $
 
 Copyright (c) 1988 Massachusetts Institute of Technology
 
@@ -115,7 +115,7 @@ MIT in each case. |#
     (1d-table/put! (condition/properties condition)
                   environment-tag
                   (if (eq? environment repl-environment)
-                      (cons (standard-repl-environment) true)
+                      (cons (nearest-repl/environment) true)
                       (cons environment false)))
     condition))
 
index 563c98672b722103a5e1331f58e9a2163785d73c..9276831ebe97ab03217e12673e1345cf96686db0 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/input.scm,v 14.2 1988/07/11 23:50:59 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/input.scm,v 14.3 1988/07/14 07:40:08 cph Exp $
 
 Copyright (c) 1988 Massachusetts Institute of Technology
 
@@ -69,45 +69,32 @@ MIT in each case. |#
   (if (not (input-port? port)) (error "Bad input port" port))
   port)
 
-(define (input-port/custom-operation port name)
-  (let ((entry (assq name (input-port/custom-operations port))))
-    (and entry
-        (cdr entry))))
-
 (define (input-port/copy port state)
   (let ((result (%input-port/copy port)))
     (set-input-port/state! result state)
     result))
 
-(define (input-port/char-ready? port interval)
-  ((input-port/operation/char-ready? port) port interval))
-
-(define (input-port/peek-char port)
-  ((input-port/operation/peek-char port) port))
-
-(define (input-port/read-char port)
-  ((input-port/operation/read-char port) port))
-
-(define (input-port/peek-char-immediate port)
-  ((input-port/operation/peek-char-immediate port) port))
-
-(define (input-port/read-char-immediate port)
-  ((input-port/operation/read-char-immediate port) port))
-
-(define (input-port/discard-char port)
-  ((input-port/operation/discard-char port) port))
-
-(define (input-port/read-string port delimiters)
-  ((input-port/operation/read-string port) port delimiters))
-
-(define (input-port/discard-chars port delimiters)
-  ((input-port/operation/discard-chars port) port delimiters))
-
-(define (input-port/read-start! port)
-  ((input-port/operation/read-start! port) port))
+(define (input-port/custom-operation port name)
+  (let ((entry (assq name (input-port/custom-operations port))))
+    (and entry
+        (cdr entry))))
 
-(define (input-port/read-finish! port)
-  ((input-port/operation/read-finish! port) port))
+(define (input-port/operation port name)
+  (or (input-port/custom-operation port name)
+      (case name
+       ((OPERATION/CHAR-READY?) (input-port/operation/char-ready? port))
+       ((OPERATION/PEEK-CHAR) (input-port/operation/peek-char port))
+       ((OPERATION/READ-CHAR) (input-port/operation/read-char port))
+       ((OPERATION/PEEK-CHAR-IMMEDIATE)
+        (input-port/operation/peek-char-immediate port))
+       ((OPERATION/READ-CHAR-IMMEDIATE)
+        (input-port/operation/read-char-immediate port))
+       ((OPERATION/DISCARD-CHAR) (input-port/operation/discard-char port))
+       ((OPERATION/READ-STRING) (input-port/operation/read-string port))
+       ((OPERATION/DISCARD-CHARS) (input-port/operation/discard-chars port))
+       ((OPERATION/READ-START!) (input-port/operation/read-start! port))
+       ((OPERATION/READ-FINISH!) (input-port/operation/read-finish! port))
+       (else false))))
 \f
 (define (make-input-port operations state)
   (let ((operations
@@ -148,7 +135,7 @@ MIT in each case. |#
                            read-start!
                            read-finish!
                            operations))))))
-\f
+
 (define (default-operation/read-string port delimiters)
   (list->string
    (let ((peek-char (input-port/operation/peek-char port))
@@ -175,6 +162,36 @@ MIT in each case. |#
   port
   false)
 \f
+(define (input-port/char-ready? port interval)
+  ((input-port/operation/char-ready? port) port interval))
+
+(define (input-port/peek-char port)
+  ((input-port/operation/peek-char port) port))
+
+(define (input-port/read-char port)
+  ((input-port/operation/read-char port) port))
+
+(define (input-port/peek-char-immediate port)
+  ((input-port/operation/peek-char-immediate port) port))
+
+(define (input-port/read-char-immediate port)
+  ((input-port/operation/read-char-immediate port) port))
+
+(define (input-port/discard-char port)
+  ((input-port/operation/discard-char port) port))
+
+(define (input-port/read-string port delimiters)
+  ((input-port/operation/read-string port) port delimiters))
+
+(define (input-port/discard-chars port delimiters)
+  ((input-port/operation/discard-chars port) port delimiters))
+
+(define (input-port/read-start! port)
+  ((input-port/operation/read-start! port) port))
+
+(define (input-port/read-finish! port)
+  ((input-port/operation/read-finish! port) port))
+
 (define eof-object
   "EOF Object")
 
index c6ee5037940bba933347c52d4ec31cfe7ab60749..94820fbf9d4cfcd0b43e24ed3e8a01ff37faa8fd 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/load.scm,v 14.2 1988/06/13 11:47:32 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/load.scm,v 14.3 1988/07/14 07:40:16 cph Exp $
 
 Copyright (c) 1988 Massachusetts Institute of Technology
 
@@ -136,7 +136,7 @@ MIT in each case. |#
                             (if purify? (purify scode))
                             scode)
                           (if (eq? environment default-object)
-                              (standard-repl-environment)
+                              (nearest-repl/environment)
                               environment)))
        (write-stream (eval-stream (read-stream port) environment syntax-table)
                      (if load-noisily?
index 0afc5e7494d239364c9fc905d5dcc2a0c3d8b7aa..4feb28fba65d499b332f5bab54694d4f3e394b8d 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/output.scm,v 14.1 1988/06/13 11:48:42 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/output.scm,v 14.2 1988/07/14 07:40:24 cph Exp $
 
 Copyright (c) 1988 Massachusetts Institute of Technology
 
@@ -64,31 +64,24 @@ MIT in each case. |#
   (if (not (output-port? port)) (error "Bad output port" port))
   port)
 
-(define (output-port/custom-operation port name)
-  (let ((entry (assq name (output-port/custom-operations port))))
-    (and entry
-        (cdr entry))))
-
 (define (output-port/copy port state)
   (let ((result (%output-port/copy port)))
     (set-output-port/state! result state)
     result))
 
-(define (output-port/write-char port char)
-  ((output-port/operation/write-char port) port char))
-
-(define (output-port/write-string port string)
-  ((output-port/operation/write-string port) port string))
+(define (output-port/custom-operation port name)
+  (let ((entry (assq name (output-port/custom-operations port))))
+    (and entry
+        (cdr entry))))
 
-(define (output-port/flush-output port)
-  ((output-port/operation/flush-output port) port))
+(define (output-port/operation port name)
+  (or (output-port/custom-operation port name)
+      (case name
+       ((WRITE-CHAR) (output-port/operation/write-char port))
+       ((WRITE-STRING) (output-port/operation/write-string port))
+       ((FLUSH-OUTPUT) (output-port/operation/flush-output port))
+       (else false))))
 
-(define (output-port/x-size port)
-  (or (let ((operation (output-port/custom-operation port 'X-SIZE)))
-       (and operation
-            (operation port)))
-      79))
-\f
 (define (make-output-port operations state)
   (let ((operations
         (map (lambda (entry)
@@ -125,6 +118,21 @@ MIT in each case. |#
   port
   false)
 \f
+(define (output-port/write-char port char)
+  ((output-port/operation/write-char port) port char))
+
+(define (output-port/write-string port string)
+  ((output-port/operation/write-string port) port string))
+
+(define (output-port/flush-output port)
+  ((output-port/operation/flush-output port) port))
+
+(define (output-port/x-size port)
+  (or (let ((operation (output-port/custom-operation port 'X-SIZE)))
+       (and operation
+            (operation port)))
+      79))
+
 (define *current-output-port*)
 
 (define-integrable (current-output-port)
index 2647663dcab18fde60c59b87760d1704038b2f89..d423d4b53c16c2235742dc40b50ca1da3950518c 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/packag.scm,v 14.2 1988/06/13 11:48:57 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/packag.scm,v 14.3 1988/07/14 07:40:31 cph Exp $
 
 Copyright (c) 1988 Massachusetts Institute of Technology
 
@@ -102,7 +102,7 @@ MIT in each case. |#
                         load/default-types)))
          (load (pathname-new-type pathname "bcon") system-global-environment)
          ((load (pathname-new-type pathname "bldr") system-global-environment)
-          (let ((syntax-table (standard-repl-syntax-table)))
+          (let ((syntax-table (nearest-repl/syntax-table)))
             (lambda (filename environment)
               (load filename environment syntax-table true)))
           options)))))
index 6658d962c757125abd0f567a47b5f0cfcfc096e1..161251c4569542c444d35cca690438b2d73ac125 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/rep.scm,v 14.3 1988/07/11 18:53:25 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/rep.scm,v 14.4 1988/07/14 07:40:37 cph Exp $
 
 Copyright (c) 1988 Massachusetts Institute of Technology
 
@@ -216,7 +216,7 @@ MIT in each case. |#
   (with-standard-proceed-point
    (lambda ()
      (breakpoint (cmdl-message/standard "^B interrupt")
-                (standard-repl-environment)))))
+                (nearest-repl/environment)))))
 \f
 ;;;; Proceed
 
@@ -330,13 +330,13 @@ MIT in each case. |#
        (repl/base parent)
        repl)))
 
-(define (standard-repl-environment)
+(define (nearest-repl/environment)
   (let ((repl (nearest-repl)))
     (if repl
        (repl/environment repl)
        user-initial-environment)))
 
-(define (standard-repl-syntax-table)
+(define (nearest-repl/syntax-table)
   (let ((repl (nearest-repl)))
     (if repl
        (repl/syntax-table repl)
@@ -346,7 +346,7 @@ MIT in each case. |#
   (let ((parent (nearest-cmdl)))
     (make-repl parent
               environment
-              (standard-repl-syntax-table)
+              (nearest-repl/syntax-table)
               prompt
               (cmdl/input-port parent)
               (cmdl/output-port parent)
index 958e11ad29c517c366983181e426085e7f06112e..d5066ba4a5bd559f2738a5bf0b51d779e15174b5 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/runtime.pkg,v 14.11 1988/07/13 18:41:50 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/runtime.pkg,v 14.12 1988/07/14 07:40:46 cph Exp $
 
 Copyright (c) 1988 Massachusetts Institute of Technology
 
@@ -615,6 +615,7 @@ MIT in each case. |#
          input-port/custom-operation
          input-port/discard-char
          input-port/discard-chars
+         input-port/operation
          input-port/operation/char-ready?
          input-port/operation/discard-char
          input-port/operation/discard-chars
@@ -965,6 +966,7 @@ MIT in each case. |#
          output-port/copy
          output-port/custom-operation
          output-port/flush-output
+         output-port/operation
          output-port/operation/flush-output
          output-port/operation/write-char
          output-port/operation/write-string
@@ -1195,6 +1197,8 @@ MIT in each case. |#
          make-repl
          nearest-cmdl
          nearest-repl
+         nearest-repl/environment
+         nearest-repl/syntax-table
          out
          proceed
          prompt-for-command-char
@@ -1224,8 +1228,6 @@ MIT in each case. |#
          set-repl/prompt!
          set-repl/reader-history!
          set-repl/syntax-table!
-         standard-repl-environment
-         standard-repl-syntax-table
          ve
          vst
          with-proceed-point
index 188e02ae8df6abe3796c7f6e9b6e3a85c090608b..05a646293b7f4d4aa8e5fb2e4d40de3c4b252b43 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/version.scm,v 14.10 1988/07/13 18:42:10 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/version.scm,v 14.11 1988/07/14 07:40:57 cph Exp $
 
 Copyright (c) 1988 Massachusetts Institute of Technology
 
@@ -45,7 +45,7 @@ MIT in each case. |#
                     '()))
   (add-system! microcode-system)
   (add-event-receiver! event:after-restore snarf-microcode-version!)
-  (add-identification! "Runtime" 14 10))
+  (add-identification! "Runtime" 14 11))
 
 (define microcode-system)
 
index 88a2bb2f90259baa68fa8dbf9bad1c95cb073eca..a0fc7a2abbe9dbb7a020663dc0133b595045125e 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/where.scm,v 14.1 1988/06/13 12:00:44 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/where.scm,v 14.2 1988/07/14 07:41:03 cph Exp $
 
 Copyright (c) 1988 Massachusetts Institute of Technology
 
@@ -72,7 +72,7 @@ MIT in each case. |#
 (define (where #!optional environment)
   (let ((environment
         (if (default-object? environment)
-            (standard-repl-environment)
+            (nearest-repl/environment)
             (->environment environment))))
     (hook/repl-environment (nearest-repl) environment)
     (fluid-let ((env environment)
index 26adf123519eb6657d43ac83113589b2b89c74a6..21cddeddb45d36a173384bf5db9c6eb6c120be09 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/runtime/load.scm,v 14.2 1988/06/13 11:47:32 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/runtime/load.scm,v 14.3 1988/07/14 07:40:16 cph Exp $
 
 Copyright (c) 1988 Massachusetts Institute of Technology
 
@@ -136,7 +136,7 @@ MIT in each case. |#
                             (if purify? (purify scode))
                             scode)
                           (if (eq? environment default-object)
-                              (standard-repl-environment)
+                              (nearest-repl/environment)
                               environment)))
        (write-stream (eval-stream (read-stream port) environment syntax-table)
                      (if load-noisily?
index 1d6990d1e9d46eb63ef5ae85510ed8e9b12e5f81..d8af7f64c5b6e06a65bd1b0fe13a9ee44170374a 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/runtime/runtime.pkg,v 14.11 1988/07/13 18:41:50 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/runtime/runtime.pkg,v 14.12 1988/07/14 07:40:46 cph Exp $
 
 Copyright (c) 1988 Massachusetts Institute of Technology
 
@@ -615,6 +615,7 @@ MIT in each case. |#
          input-port/custom-operation
          input-port/discard-char
          input-port/discard-chars
+         input-port/operation
          input-port/operation/char-ready?
          input-port/operation/discard-char
          input-port/operation/discard-chars
@@ -965,6 +966,7 @@ MIT in each case. |#
          output-port/copy
          output-port/custom-operation
          output-port/flush-output
+         output-port/operation
          output-port/operation/flush-output
          output-port/operation/write-char
          output-port/operation/write-string
@@ -1195,6 +1197,8 @@ MIT in each case. |#
          make-repl
          nearest-cmdl
          nearest-repl
+         nearest-repl/environment
+         nearest-repl/syntax-table
          out
          proceed
          prompt-for-command-char
@@ -1224,8 +1228,6 @@ MIT in each case. |#
          set-repl/prompt!
          set-repl/reader-history!
          set-repl/syntax-table!
-         standard-repl-environment
-         standard-repl-syntax-table
          ve
          vst
          with-proceed-point