Next: Gray Streams examples, Previous: Character input stream methods, Up: Gray Streams
These generic functions are used to implement subclasses of fundamental-character-output-stream:
Write enough blank space so that the next character will be written at the specified column. Returns true if the operation is successful, or
nil
if it is not supported for this stream. This is intended for use by bypprint
andformat
~T. The default method usesstream-line-column
and repeated calls tostream-write-char
with a #SPACE character; it returnsnil
ifstream-line-column
returnsnil
.
Outputs a new line to the Stream if it is not positioned at the begining of a line. Returns
t
if it output a new line, nil otherwise. Used byfresh-line
. The default method usesstream-start-line-p
andstream-terpri
.
Return the column number where the next character will be written, or
nil
if that is not meaningful for this stream. The first column on a line is numbered 0. This function is used in the implementation ofpprint
and theformat
~T directive. For every character output stream class that is defined, a method must be defined for this function, although it is permissible for it to always returnnil
.
Is
stream
known to be positioned at the beginning of a line? It is permissible for an implementation to always returnnil
. This is used in the implementation offresh-line
. Note that while a value of 0 fromstream-line-column
also indicates the beginning of a line, there are cases wherestream-start-line-p
can be meaningfully implemented althoughstream-line-column
can't be. For example, for a window using variable-width characters, the column number isn't very meaningful, but the beginning of the line does have a clear meaning. The default method forstream-start-line-p
on classfundamental-character-output-stream
usesstream-line-column
, so if that is defined to returnnil
, then a method should be provided for eitherstream-start-line-p
orstream-fresh-line
.
Writes an end of line, as for
terpri
. Returnsnil
. The default method does (STREAM-WRITE-CHAR stream #NEWLINE).
Write
character
tostream
and returncharacter
. Every subclass offundamental-character-output-stream
must have a method defined for this function.
This is used by
write-string
. It writes the string to the stream, optionally delimited by start and end, which default to 0 andnil
. The string argument is returned. The default method provided byfundamental-character-output-stream
uses repeated calls tostream-write-char
.