Put another way: What do we mean when we say "text file," exactly? After all, any 8-bit code can be interpreted as a character (printable or otherwise). This has been conceptualized as Faithful Output with Character Streams, which means that an (8-bit) char-code is not altered in transit. But a text file is a human-readable stream (weird delimiters aside). Many binary formats are container formats, and may contain text, either as metadata or as actual content. Thus a document will likely contain text, but isn't necessarily a "text file."
Clozure CL
In CCL, both socket streams and vector streams are bivalent, whereas file streams are not.
Allegro CL
In ACL, not specifying an element type gives you a simple stream, which is bivalent:
Specifying an element type, on the other hand, gives you a Gray Stream:
LispWorks
In LispWorks, binary streams are bivalent. Here's a somewhat unusual example:
Take careful note of what's happening here:
- Reading one character didn't actually consume a 32-bit "byte."
- This is because the stream is using an 8-bit character encoding.
- So after calling read-char, those 8 bits are still in the buffer.
- Then read-byte will consume this octet—plus three more.
SBCL
In SBCL, one obtains a bivalent stream by specifying :default as the element type. Bear in mind that :default is not the actual default.
ECL
In ECL, character streams are bivalent:
Clasp
In Clasp, binary streams are bivalent.
Programming Tips