Gray steam non-conformance: not invoking STREAM-CLEAR-OUTPUT and STREAM-ADVANCE-TO-COLUMN
|Reported by:||avodonosov||Owned by:||rtoy|
As we can see from the trivial-gray-streams test suite:
CMUCL does not call some generic functions when necessary:
- When we call cl:clear-output for a gray stream, CMUCL calls ext:stream-force-output instead of ext:stream-clear-output
- When we call cl:format with the ~T directive, for example (cl:format a-gray-stream "~10,t"), CMUCL calls ext:stream-line-column and ext:stream-write-string instead of ext:stream-advance-to-column
See the specification: http://www.nhplace.com/kent/CL/Issues/stream-definition-by-user.html
STREAM-ADVANCE-TO-COLUMN stream column [Generic Function]
Writes 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 by PPRINT and FORMAT ~T. The default method uses STREAM-LINE-COLUMN and repeated calls to STREAM-WRITE-CHAR with a #\SPACE character; it returns NIL if STREAM-LINE-COLUMN returns NIL.
So, it is better to call ext:stream-advance-to-column, and provide the default implementation for ext:stream-advance-to-column, as specified.
Importance: I am unaware of a library that depend on those Gray protocol details. But it is non-conforming.
Change History (5)
comment:1 Changed 3 years ago by avodonosov
- Component changed from Core to Gray-streams
- Owner changed from somebody to rtoy
comment:3 Changed 3 years ago by toy.raymond@…
- Resolution set to fixed
- Status changed from new to closed