Empty-type vectors are written as junk strings
Bug #1311421 reported by
James M. Lawrence
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
* (write (make-array 10 :element-type nil))
"£KÇ...<other junk>"
Possibly this could be a security concern? In any case it's crude.
New version:
* (write (make-array 10 :element-type nil))
#<(SIMPLE-ARRAY NIL (10)) {C9FEC8F}>
Vectors of the empty type that are empty may be printed readably:
* (write (make-array 0 :element-type nil) :readably t)
#.(COERCE #() '(SIMPLE-ARRAY NIL (*)))
Changed in sbcl: | |
status: | Invalid → Triaged |
Changed in sbcl: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
On second thought, I suppose this violates the specification (http:// www.ai. mit.edu/ projects/ iiip/doc/ CommonLISP/ HyperSpec/ Body/sec_ 22-1-3- 4.html), which says that a double-quote must be printed before and after. Therefore "" would be the representation of an empty string with characters of type nil.
Thus the fix would be to signal an error when an element of an empty-type string is accessed via the stream functionality, just as using AREF signals an error.