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
nilif it is not supported for this stream. This is intended for use by bypprintandformat~T. The default method usesstream-line-columnand repeated calls tostream-write-charwith a#spacecharacter; it returnsnilifstream-line-columnreturnsnil.
Outputs a new line to the Stream if it is not positioned at the begining of a line. Returns
tif it output a new line, nil otherwise. Used byfresh-line. The default method usesstream-start-line-pandstream-terpri.
Return the column number where the next character will be written, or
nilif that is not meaningful for this stream. The first column on a line is numbered 0. This function is used in the implementation ofpprintand 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
streamknown 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-columnalso indicates the beginning of a line, there are cases wherestream-start-line-pcan be meaningfully implemented althoughstream-line-columncan'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-pon classfundamental-character-output-streamusesstream-line-column, so if that is defined to returnnil, then a method should be provided for eitherstream-start-line-porstream-fresh-line.
Writes an end of line, as for
terpri. Returnsnil. The default method does (STREAM-WRITE-CHAR stream #NEWLINE).
Write
charactertostreamand returncharacter. Every subclass offundamental-character-output-streammust 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-streamuses repeated calls tostream-write-char.