Skip to content
Snippets Groups Projects
Commit 3eeefd6b authored by emarsden's avatar emarsden
Browse files

More ANSI-compliance BROADCAST-STREAM fixes:

  - FILE-LENGTH and FILE-POSITION return the value from the last component
    stream, or 0 if there are no component streams.

Will require a similar change for FILE-STRING-LENGTH (and addition of a
:file-string-length misc-op).
parent afa6bbfb
No related branches found
No related tags found
No related merge requests found
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain. ;;; Carnegie Mellon University, and has been placed in the public domain.
;;; ;;;
(ext:file-comment (ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/stream.lisp,v 1.70 2004/04/06 17:30:12 emarsden Exp $") "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/stream.lisp,v 1.71 2004/04/07 11:03:38 emarsden Exp $")
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
...@@ -970,6 +970,17 @@ streams." ...@@ -970,6 +970,17 @@ streams."
(dolist (stream streams min) (dolist (stream streams min)
(let ((res (line-length stream))) (let ((res (line-length stream)))
(when res (setq min (if min (min res min) res))))))) (when res (setq min (if min (min res min) res)))))))
;; CLHS: The functions file-length, file-position, file-string-length, and
;; stream-external-format return the value from the last component
;; stream; if there are no component streams, file-length and
;; file-position return 0, file-string-length returns 1, and
;; stream-external-format returns :default.
(:file-length
(if (null streams) 0
(file-length (last streams))))
(:file-position
(if (null streams) 0
(file-position (last streams))))
(:element-type (:element-type
#+nil ; old, arguably more logical, version #+nil ; old, arguably more logical, version
(let (res) (let (res)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment