From: Stas B. <sta...@gm...> - 2015-02-27 21:23:01
|
Zach Beane <xa...@xa...> writes: > I've been gathering some metadata from ASDF systems and printing it to a > file. Everything was going fine, until I got to a project (colleen) that > had a :depends-on like this: > > :depends-on (:bordeaux-threads :universal-config :verbose :split-sequence ...) > > asdf:system-depends-on returns: > > ("bordeaux-threads" "universal-config" "verbose" "split-sequence" ...) > > I tried to print that list to a stream, and I thought I'd avoid > unexpected printing state with with-standard-io-syntax. But it turned > out the "verbose" string was actually a simple-base-string, so it > signaled an error about printing readably. > > For now I've just eliminated the with-standard-io-syntax. I thought I'd > mention it here. > > Credit for figuring out that :version was the source of the > simple-base-string goes to "scymtym" on #lisp. > > What is the takeaway here? Never assume that you can readably print any > particular string if it comes from symbol-name? with-standard-io-syntax > is not suitable for careless use? Something else? I'm not sure. Yeah, it's been forever that base strings are not printable readably. Just printing "" wouldn't reconstruct the original array, as it defaults to CHARACTER. But I'm not quite sure why it doesn't print as #.(COERCE "" 'simple-base-string), since it does that for other specialized arrays. Maybe some weird CLHS requirement on how strings should be printed. -- With best regards, Stas. |