X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fpcl%2Fgray-streams.lisp;h=f4b407604a6b1d706ec85891e595de154e200c2f;hb=b19093fa94d6e1785abee99c35c9a610e8777671;hp=f34ebbbec50b4cd0f0cd938c833c9e12299cc9f1;hpb=a530bbe337109d898d5b4a001fc8f1afa3b5dc39;p=sbcl.git diff --git a/src/pcl/gray-streams.lisp b/src/pcl/gray-streams.lisp index f34ebbb..f4b4076 100644 --- a/src/pcl/gray-streams.lisp +++ b/src/pcl/gray-streams.lisp @@ -9,9 +9,6 @@ ;;;; warranty. See the COPYING and CREDITS files for more information. (in-package "SB-GRAY") - -(sb-int:file-comment - "$Header$") (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)) @@ -57,13 +54,18 @@ (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) (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)) @@ -208,6 +210,9 @@ 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) @@ -322,7 +327,7 @@ (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))) @@ -346,6 +351,9 @@ "Implements WRITE-BYTE; writes the integer to the stream and returns the integer as the result.")) +#| +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)) @@ -418,3 +426,4 @@ (defmethod stream-clear-input ((stream character-input-stream)) (clear-input (character-input-stream-lisp-stream stream))) +|#