stream-element-type unset within pprint-logical-block
Bug #800010 reported by
Mark Cox
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Triaged
|
Low
|
Unassigned |
Bug Description
The value of STREAM-ELEMENT-TYPE changes within a PPRINT-
(format t "~&Before: ~A~%" (stream-
(pprint-
(format t "~&Logical Block: ~A~%" (stream-
For the above code, SBCL 1.0.48.35 produces
Before: CHARACTER
Logical Block: NIL
Changed in sbcl: | |
importance: | Undecided → Low |
status: | New → Triaged |
tags: | added: printer streams |
tags: | added: easy |
To post a comment you must log in.
The reason is that a PRETTY-STREAM is an ANSI-STREAM, so STREAM-ELEMENT-TYPE delegates to the ANSI-STREAM-MISC of the stream, which is SB-PRETTY: :PRETTY- MISC for PRETTY-STREAMs. PRETTY-MISC returns NIL for (EQ OP :ELEMENT-TYPE). This is the definition:
(defun pretty-misc (stream op &optional arg1 arg2)
(declare (ignore stream op arg1 arg2)))
I'm not sure what the fix should look like. Maybe something like this?
(defun pretty-misc (stream op &optional arg1 arg2) element- type) (stream- element- type (pretty- stream- target stream)))))
(declare (ignore arg1 arg2))
(case op
((:
Are there other -MISC features that PRETTY-STREAMs should hand through to the target stream?