The following functions provide line-based input and output operations.
The newline sequence for string streams is a sequence comprising the single newline character \n. For character file streams, the newline sequence is whatever sequence of characters the underlying platform uses to represent a newline. For example, on MS-DOS platforms, the sequence comprises two characters: a carriage return followed by a linefeed.
Note: No other functions in the Streams module do anything to manage the encoding of newlines; calling write-element on the character \n does not cause the \n character to be written as the native newline sequence, unless \n happens to be the native newline sequence.
Open generic function
read-line input-stream #key on-end-of-stream => string-or-eof newline?
<string> containing all the input in input-stream up to the next newline. The string does not contain the newline itself.
#t if the read terminated with a newline or #f if the read terminated because it came to the end of the stream.
<byte-character>, the string will be a <byte-string>.
Open generic function
write-line output-stream string #key start end => ()
write on string and then calls new-line, with output-stream locked across both calls.
.size respectively.
Open generic function
new-line output-stream => ()
new-line is defined on <string-stream> that writes the character \n to the string stream.
See also read-line-into!, page 87.