The value NIL is not of type STREAM.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
1 I do:
(defun my-princ (object &optional output-stream)
(write object
==> MY-PRINC
(my-princ '(hello World))
then signals a TYPE-ERROR
The value NIL is not of type STREAM.
(SB-PRETTY:
seems that the stream designator NIL is passed
that function which expects a stream instead.
What I expect is
(my-princ '(hello World))
(HELLO WORLD)
==> (HELLO WORLD)
Just like when I do
(write '(Hello World)
:stream nil
:readably nil
:escape nil)
which indeed behaves as expected:
See also:
CLHS 22.4 The Printer Dictionary
-> Function WRITE, PRIN1, PRINT, PPRINT, PRINC
This problem only occurs when MY-PRINC-ing lists.
With numbers, however, there is another problem:
(my-princ 12) ; will return a wrong value
12
==> NIL
but the equivalent write expression correctly gives
(write 12 :stream nil :readably nil :escape nil)
12
==>12
2 $ sbcl --version
SBCL 1.0.25.debian
3 $ uname -a
Linux pc92-e03-3 2.6.32-trunk-686 #1 SMP Sun Jan 10 06:32:16 UTC 2010 i686 GNU/Linux
4 *FEATURES*
==> (:SB-FUTEX :SB-THREAD :ANSI-CL :COMMON-LISP :SBCL :SB-DOC :SB-TEST :SB-LDB
:SB-
:IEEE-
:STACK-
:COMPARE-
:STACK-
:OS-
tags: | added: review |
Changed in sbcl: | |
assignee: | nobody → Nikodemus Siivola (nikodemus) |
Changed in sbcl: | |
status: | Fix Committed → Fix Released |
That's another problem with WRITE compiler macro (https:/ /bugs.launchpad .net/sbcl/ +bug/581564)
I attached a patch which combines fixing the above mentioned ticket and this issue. And it fixes another issue, compiler-macro returns NIL, while it should return an object.