Opened 10 years ago
Closed 10 years ago
#102 closed defect (duplicate)
Gray steam non-conformance: not invoking STREAM-CLEAR-OUTPUT and STREAM-ADVANCE-TO-COLUMN
Reported by: | Anton Vodonosov | Owned by: | somebody |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | Core | Version: | 2014-05 |
Keywords: | Cc: |
Description
As we can see from the trivial-gray-streams test suite:
http://cl-test-grid.appspot.com/blob?key=eefx5t0o0r https://github.com/trivial-gray-streams/trivial-gray-streams/blob/master/test/test.lisp
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.