Change peek-char, read-char, and read-string operations to return EOF
authorChris Hanson <org/chris-hanson/cph>
Fri, 9 Nov 1990 08:56:28 +0000 (08:56 +0000)
committerChris Hanson <org/chris-hanson/cph>
Fri, 9 Nov 1990 08:56:28 +0000 (08:56 +0000)
objects when they reach the end of the input region.  This is an
incompatible change required by runtime system version 14.101.

v7/src/edwin/bufinp.scm
v7/src/edwin/make.scm

index afbcdc9099cc1f37a71510e0ebfb6ea9444a362c..8b5592c1b98825d1b62e80906555aa8683ea9283 100644 (file)
@@ -1,8 +1,8 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/bufinp.scm,v 1.2 1989/04/28 22:47:26 cph Rel $
+;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/bufinp.scm,v 1.3 1990/11/09 08:56:14 cph Rel $
 ;;;
-;;;    Copyright (c) 1986, 1989 Massachusetts Institute of Technology
+;;;    Copyright (c) 1986, 1989, 1990 Massachusetts Institute of Technology
 ;;;
 ;;;    This material was developed by the Scheme project at the
 ;;;    Massachusetts Institute of Technology, Department of
 (define (operation/peek-char port)
   (let ((state (input-port/state port)))
     (let ((current-index (buffer-input-port-state/current-index state)))
-      (and (< current-index (buffer-input-port-state/end-index state))
-          (group-right-char (buffer-input-port-state/group state)
-                            current-index)))))
+      (if (< current-index (buffer-input-port-state/end-index state))
+         (group-right-char (buffer-input-port-state/group state)
+                           current-index)
+         (make-eof-object port)))))
 
 (define (operation/discard-char port)
   (let ((state (input-port/state port)))
 (define (operation/read-char port)
   (let ((state (input-port/state port)))
     (let ((current-index (buffer-input-port-state/current-index state)))
-      (and (< current-index (buffer-input-port-state/end-index state))
-          (let ((char
-                 (group-right-char (buffer-input-port-state/group state)
-                                   current-index)))
-            (set-buffer-input-port-state/current-index! state
-                                                        (1+ current-index))
-            char)))))
+      (if (< current-index (buffer-input-port-state/end-index state))
+         (let ((char
+                (group-right-char (buffer-input-port-state/group state)
+                                  current-index)))
+           (set-buffer-input-port-state/current-index! state
+                                                       (1+ current-index))
+           char)
+         (make-eof-object port)))))
 
 (define (operation/read-string port delimiters)
   (let ((state (input-port/state port)))
          (end-index (buffer-input-port-state/end-index state))
          (group (buffer-input-port-state/group state)))
       (if (>= current-index end-index)
-         ""
+         (make-eof-object port)
          (let ((new-index
                 (or (%find-next-char-in-set group current-index end-index
                                             delimiters)
index 3209885d31deb6891f17d70068ee81b9e4c5ea81..ddca76c2faee90e630d170131c5e0b8dfdf44386 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/make.scm,v 3.22 1990/11/02 04:19:34 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/make.scm,v 3.23 1990/11/09 08:56:28 cph Exp $
 
 Copyright (c) 1989, 1990 Massachusetts Institute of Technology
 
@@ -37,4 +37,4 @@ MIT in each case. |#
 (declare (usual-integrations))
 
 (package/system-loader "edwin" '() 'QUERY)
-(add-system! (make-system "Edwin" 3 22 '()))
\ No newline at end of file
+(add-system! (make-system "Edwin" 3 23 '()))
\ No newline at end of file