From: Christophe Rhodes Date: Wed, 4 Feb 2004 15:48:43 +0000 (+0000) Subject: 0.8.7.42: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=e14f0127e999b95d759aec2195534bb5806b7152;p=sbcl.git 0.8.7.42: Make STREAM-ELEMENT-TYPE and FRESH-LINE work better on BROADCAST-STREAMs ... also fix various odd close behaviours -- compound streams should probably all get closed by CLOSE, even if their constituents don't --- diff --git a/NEWS b/NEWS index 2061986..df38115 100644 --- a/NEWS +++ b/NEWS @@ -2294,8 +2294,10 @@ changes in sbcl-0.8.8 relative to sbcl-0.8.7: signal a TYPE-ERROR if their argument is not a stream. ** READ-BYTE and WRITE-BYTE signal a TYPE-ERROR if their stream designator argument does not designate a stream. - ** OPEN-STREAM-P and INPUT-STREAM-P on synonym streams work by examining - the synonym. + ** OPEN-STREAM-P and INPUT-STREAM-P on synonym streams work by + examining the synonym. + ** STREAM-ELEMENT-TYPE and FRESH-LINE on broadcast-streams now + work as specified. planned incompatible changes in 0.8.x: * (not done yet, but planned:) When the profiling interface settles diff --git a/src/code/stream.lisp b/src/code/stream.lisp index 931b653..f436ab0 100644 --- a/src/code/stream.lisp +++ b/src/code/stream.lisp @@ -597,8 +597,20 @@ (defun broadcast-misc (stream operation &optional arg1 arg2) (let ((streams (broadcast-stream-streams stream))) (case operation + ;; FIXME: This may not be the best place to note this, but I + ;; think the :CHARPOS protocol needs revision. Firstly, I think + ;; this is the last place where a NULL return value was possible + ;; (before adjusting it to be 0), so a bunch of conditionals IF + ;; CHARPOS can be removed; secondly, it is my belief that + ;; FD-STREAMS, when running FILE-POSITION, do not update the + ;; CHARPOS, and consequently there will be much wrongness. + ;; + ;; FIXME: see also TWO-WAY-STREAM treatment of :CHARPOS -- why + ;; is it testing the :charpos of an input stream? + ;; + ;; -- CSR, 2004-02-04 (:charpos - (dolist (stream streams) + (dolist (stream streams 0) (let ((charpos (charpos stream))) (if charpos (return charpos))))) (:line-length @@ -607,10 +619,18 @@ (let ((res (line-length stream))) (when res (setq min (if min (min res min) res))))))) (:element-type + #+nil ; old, arguably more logical, version (let (res) - (dolist (stream streams (if (> (length res) 1) `(and ,@res) res)) - (pushnew (stream-element-type stream) res :test #'equal)))) - (:close) + (dolist (stream streams (if (> (length res) 1) `(and ,@res) t)) + (pushnew (stream-element-type stream) res :test #'equal))) + ;; ANSI-specified version (under System Class BROADCAST-STREAM) + (let ((res t)) + (do ((streams streams (cdr streams))) + ((null streams) res) + (when (null (cdr streams)) + (setq res (stream-element-type (car streams))))))) + (:close + (set-closed-flame stream)) (t (let ((res nil)) (dolist (stream streams res) @@ -1402,7 +1422,8 @@ (defun case-frob-misc (stream op &optional arg1 arg2) (declare (type case-frob-stream stream)) (case op - (:close) + (:close + (set-closed-flame stream)) (t (let ((target (case-frob-stream-target stream))) (if (ansi-stream-p target) diff --git a/version.lisp-expr b/version.lisp-expr index c5a028c..f1fec0a 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.8.7.41" +"0.8.7.42"