Broadcast streams with no components can't be closed
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
The close method for a broadcast stream does nothing if the stream has no components:
--
(with-open-stream (bs (make-broadcast
(values (close bs)
=> T
=> T
--
This is not obviously conforming of SBCL, not a behavior that a program can conformingly benefit from, and not a feature that a program can use very portably (ABCL, Allegro, Clisp, ECL, LispWorks all close the broadcast stream, though CCL and CMUCL don't).
Might as well close the stream.
Noticed this while looking into https:/
$ uname -a
Darwin m5.local 19.6.0 Darwin Kernel Version 19.6.0: Mon Aug 31 22:12:52 PDT 2020; root:xnu-
$ sbcl --version
SBCL 2.0.0
$ sbcl --no-userinit --no-sysinit --non-interactive --eval '(format t "~{~S~%~}" *features*)'
This is SBCL 2.0.0, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://
SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
:X86-64
:64-BIT
:ALIEN-CALLBACKS
:ANSI-CL
:AVX2
:BSD
:C-STACK-
:CALL-SYMBOL
:COMMON-LISP
:COMPACT-
:COMPARE-
:CYCLE-COUNTER
:DARWIN
:FP-AND-
:GENCGC
:IEEE-FLOATING-
:IMMOBILE-CODE
:IMMOBILE-SPACE
:INODE64
:INTEGER-EQL-VOP
:LINKAGE-TABLE
:LITTLE-ENDIAN
:MACH-EXCEPTION
:MACH-O
:OS-PROVIDES-
:OS-PROVIDES-DLADDR
:OS-PROVIDES-DLOPEN
:OS-PROVIDES-PUTWC
:OS-PROVIDES-
:PACKAGE-
:SB-CORE-
:SB-DOC
:SB-EVAL
:SB-LDB
:SB-PACKAGE-LOCKS
:SB-SIMD-PACK
:SB-SIMD-PACK-256
:SB-SOURCE-
:SB-THREAD
:SB-UNICODE
:SBCL
:STACK-
:STACK-
:STACK-
:STACK-
:STACK-
:UNDEFINED-
:UNIX
:UNWIND-
Changed in sbcl: | |
status: | New → Fix Committed |
Changed in sbcl: | |
status: | Fix Committed → Fix Released |
The broadcast stream with no constituent streams is a singleton object. stream- always- construct- new-stream, are you seriously suggesting that people would want that? I didn't think so.
This is useful in that it is the lisp equivalent of /dev/null, and various operations might be able to take advantage of detecting that singleton object and doing nothing.
Supposing there were a build-time feature for #+broadcast-