0.pre7.38:
[sbcl.git] / src / pcl / gray-streams.lisp
index f34ebbb..f4b4076 100644 (file)
@@ -9,9 +9,6 @@
 ;;;; warranty. See the COPYING and CREDITS files for more information.
 
 (in-package "SB-GRAY")
-
-(sb-int:file-comment
-  "$Header$")
 \f
 (fmakunbound 'stream-element-type)
 
@@ -39,7 +36,7 @@
   (not (eq (lisp-stream-in stream) #'closed-flame)))
 
 (defmethod pcl-open-stream-p ((stream fundamental-stream))
-  nil)
+  (stream-open-p stream))
 
 ;;; bootstrapping hack
 (pcl-open-stream-p (make-string-output-stream))
     (funcall (lisp-stream-misc stream) stream :close abort))
   t)
 
+(defmethod pcl-close ((stream fundamental-stream) &key abort)
+  (declare (ignore abort))
+  (setf (stream-open-p stream) nil)
+  t)
+
 (setf (fdefinition 'close) #'pcl-close)
 \f
 (fmakunbound 'input-stream-p)
 
 (defgeneric input-stream-p (stream)
   #+sb-doc
-  (:documentation "Returns non-nil if the given Stream can perform input operations."))
+  (:documentation "Return non-nil if the given Stream can perform input operations."))
 
 (defmethod input-stream-p ((stream lisp-stream))
   (and (not (eq (lisp-stream-in stream) #'closed-flame))
@@ -77,7 +79,7 @@
 
 (defgeneric output-stream-p (stream)
   #+sb-doc
-  (:documentation "Returns non-nil if the given Stream can perform output operations."))
+  (:documentation "Return non-nil if the given Stream can perform output operations."))
 
 (defmethod output-stream-p ((stream lisp-stream))
   (and (not (eq (lisp-stream-in stream) #'closed-flame))
   defined for this function, although it is permissible for it to
   always return NIL."))
 
+(defmethod stream-line-column ((stream fundamental-character-output-stream))
+   nil)
+
 ;;; STREAM-LINE-LENGTH is a CMU CL extension to Gray streams.
 ;;; FIXME: Should we support it? Probably not..
 (defgeneric stream-line-length (stream)
   (let ((current-column (stream-line-column stream)))
     (when current-column
       (let ((fill (- column current-column)))
-       (dotimes-fixnum (i fill)
+       (dotimes (i fill)
          (stream-write-char stream #\Space)))
       T)))
 \f
    "Implements WRITE-BYTE; writes the integer to the stream and
   returns the integer as the result."))
 \f
+#|
+This is not in the gray-stream proposal, so it is left here
+as example code.
 ;;; example character output stream encapsulating a lisp-stream
 (defun make-character-output-stream (lisp-stream)
   (declare (type lisp-stream lisp-stream))
 
 (defmethod stream-clear-input ((stream character-input-stream))
   (clear-input (character-input-stream-lisp-stream stream)))
+|#