write-line
(write-line string &optional stream &key start end)
Writes the given string followed by a newline, and returns the string. With no stream argument it writes to standard output; given an output stream it writes there instead -- a file stream opened by open or with-open-file, a socket, or a with-output-to-string string stream. Works in all three backends. Unlike print/prin1, it writes the raw string contents without surrounding quotes. The :start/:end keywords bound the written substring (a nil :end means the string's length); the full string is still the return value. A range outside the string (:start below 0, :end past the length, or :start after :end) or a non-nil bound that is not an integer is the same type-error as subseq's, on every backend. A CLOS instance extending rontolisp's Gray output-stream base class also works as the stream -- the bounds are checked first (a nil :start is refused like any other bad bound) and then reach rontolisp:stream-write-string's own start/end as integers.
(with-open-file (out "greeting.txt" :direction :output)
(write-line "hello" out)
(write-line "world" out))
This writes two lines, hello and world, into greeting.txt. Each call appends its own trailing newline and returns the string it wrote.
write-line still returns the whole string "hello"; only the written bytes are bounded.