Change back to using a single EOF object.
authorChris Hanson <org/chris-hanson/cph>
Fri, 19 Nov 2004 07:00:01 +0000 (07:00 +0000)
committerChris Hanson <org/chris-hanson/cph>
Fri, 19 Nov 2004 07:00:01 +0000 (07:00 +0000)
v7/src/runtime/input.scm
v7/src/runtime/port.scm
v7/src/runtime/runtime.pkg

index 0787e2536a410f3450fac646558ab16d98994e13..5c4e88fcd2d18580f218c7a9f3cadb82b92107c1 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: input.scm,v 14.28 2004/11/04 03:00:15 cph Exp $
+$Id: input.scm,v 14.29 2004/11/19 06:59:41 cph Exp $
 
 Copyright 1986,1987,1988,1989,1990,1991 Massachusetts Institute of Technology
 Copyright 1992,1993,1997,1999,2002,2003 Massachusetts Institute of Technology
@@ -133,25 +133,12 @@ USA.
 (define-integrable (accum-count a)
   (cdr a))
 
-(define-record-type <eof-object>
-    (%make-eof-object port)
-    eof-object?
-  (port eof-object-port))
-
 (define (make-eof-object port)
-  (if port
-      (begin
-       (guarantee-input-port port 'MAKE-EOF-OBJECT)
-       (or (port/eof-object port)
-           (let ((eof (%make-eof-object port)))
-             (set-port/eof-object! port eof)
-             eof)))
-      (or saved-eof-object
-         (let ((eof (%make-eof-object port)))
-           (set! saved-eof-object eof)
-           eof))))
-
-(define saved-eof-object #f)
+  port
+  (object-new-type (ucode-type constant) 6))
+
+(define (eof-object? object)
+  (eq? object (object-new-type (ucode-type constant) 6)))
 \f
 ;;;; High level
 
index 8aacd3d0ffcdfbcd6bc0afe13de9d93234027ebc..fd849c5db263cb148206e23a7387a8b645747380 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: port.scm,v 1.35 2004/11/04 03:00:25 cph Exp $
+$Id: port.scm,v 1.36 2004/11/19 06:59:50 cph Exp $
 
 Copyright 1991,1992,1993,1994,1997,1999 Massachusetts Institute of Technology
 Copyright 2001,2002,2003,2004 Massachusetts Institute of Technology
@@ -653,12 +653,6 @@ USA.
   (let ((tport (port/transcript port)))
     (if tport
        (output-port/discretionary-flush tport))))
-
-(define (port/eof-object port)
-  (port/get-property port 'EOF-OBJECT #f))
-
-(define (set-port/eof-object! port eof)
-  (port/set-property! port 'EOF-OBJECT eof))
 \f
 (define (input-port? object)
   (and (port? object)
index fe8615b9f73bc54ffd8b4af55b705adff539a861..6223d2ec1c1c7bf6825594155d6ee23067de327b 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: runtime.pkg,v 14.514 2004/11/19 06:56:21 cph Exp $
+$Id: runtime.pkg,v 14.515 2004/11/19 07:00:01 cph Exp $
 
 Copyright 1988,1989,1990,1991,1992,1993 Massachusetts Institute of Technology
 Copyright 1994,1995,1996,1997,1998,1999 Massachusetts Institute of Technology
@@ -1908,7 +1908,6 @@ USA.
          with-output-to-port
          with-trace-output-port)
   (export (runtime input-port)
-         port/eof-object
          port/operation/char-ready?
          port/operation/discard-char
          port/operation/peek-char
@@ -1916,8 +1915,7 @@ USA.
          port/operation/read-external-substring
          port/operation/read-substring
          port/operation/read-wide-substring
-         port/operation/unread-char
-         set-port/eof-object!)
+         port/operation/unread-char)
   (export (runtime output-port)
          port/operation/discretionary-flush-output
          port/operation/flush-output
@@ -1946,7 +1944,6 @@ USA.
   (export ()
          char-ready?
          discard-char
-         eof-object-port
          eof-object?
          input-port/char-ready?
          input-port/discard-char