Skip to content

Commit

Permalink
Use STREAMP to determine Gray stream API availability
Browse files Browse the repository at this point in the history
  • Loading branch information
yitzchak authored and easye committed Dec 13, 2023
1 parent 5dda781 commit f4ebe57
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
8 changes: 2 additions & 6 deletions src/org/armedbear/lisp/Lisp.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 1 addition & 3 deletions src/org/armedbear/lisp/gray-streams.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f4ebe57

Please sign in to comment.