From f4ebe57e439574828291064f30bdcee9c06a28ff Mon Sep 17 00:00:00 2001 From: "Tarn W. Burton" Date: Tue, 12 Dec 2023 12:37:13 -0500 Subject: [PATCH] Use STREAMP to determine Gray stream API availability --- src/org/armedbear/lisp/Lisp.java | 8 ++------ src/org/armedbear/lisp/gray-streams.lisp | 4 +--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/org/armedbear/lisp/Lisp.java b/src/org/armedbear/lisp/Lisp.java index 2b8c3b444..5a940ac88 100644 --- a/src/org/armedbear/lisp/Lisp.java +++ b/src/org/armedbear/lisp/Lisp.java @@ -1950,12 +1950,8 @@ public static final Stream checkStream(LispObject obj) if (obj instanceof Stream) { return (Stream) obj; } - if (obj instanceof StandardObject) { - Function subtypep = checkFunction(Symbol.SUBTYPEP.getSymbolFunction()); - if (subtypep.execute(obj.typeOf(), Symbol.STREAM).equals(T)) { - Stream result = GrayStream.findOrCreate(obj); - return result; - } + if (Symbol.STREAMP.getSymbolFunction().execute(obj).getBooleanValue()) { + return GrayStream.findOrCreate(obj); } return (Stream) // Not reached. type_error(obj, Symbol.STREAM); diff --git a/src/org/armedbear/lisp/gray-streams.lisp b/src/org/armedbear/lisp/gray-streams.lisp index e5b7aa691..c5d041b24 100644 --- a/src/org/armedbear/lisp/gray-streams.lisp +++ b/src/org/armedbear/lisp/gray-streams.lisp @@ -194,9 +194,7 @@ (defvar *ansi-file-length* #'cl:file-length) (defun ansi-streamp (stream) - (not - (subtypep (class-of stream) - 'gray-streams::fundamental-stream))) + (typep stream '(or sys::system-stream xp::xp-structure))) (defclass fundamental-stream (standard-object stream) ((open-p :initform t