From eb8a9c916aefc40617545fe1e3a651334e8116c4 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Fri, 19 Nov 2004 07:00:01 +0000 Subject: [PATCH] Change back to using a single EOF object. --- v7/src/runtime/input.scm | 25 ++++++------------------- v7/src/runtime/port.scm | 8 +------- v7/src/runtime/runtime.pkg | 7 ++----- 3 files changed, 9 insertions(+), 31 deletions(-) diff --git a/v7/src/runtime/input.scm b/v7/src/runtime/input.scm index 0787e2536..5c4e88fcd 100644 --- a/v7/src/runtime/input.scm +++ b/v7/src/runtime/input.scm @@ -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 - (%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))) ;;;; High level diff --git a/v7/src/runtime/port.scm b/v7/src/runtime/port.scm index 8aacd3d0f..fd849c5db 100644 --- a/v7/src/runtime/port.scm +++ b/v7/src/runtime/port.scm @@ -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)) (define (input-port? object) (and (port? object) diff --git a/v7/src/runtime/runtime.pkg b/v7/src/runtime/runtime.pkg index fe8615b9f..6223d2ec1 100644 --- a/v7/src/runtime/runtime.pkg +++ b/v7/src/runtime/runtime.pkg @@ -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 -- 2.25.1