close Warning: Can't synchronize with repository "(default)" ("(default)" is not readable or not a Git repository.). Look in the Trac log for more information.

Opened 7 years ago

Closed 7 years ago

#103 closed defect (duplicate)

Gray steam non-conformance: not invoking STREAM-CLEAR-OUTPUT and STREAM-ADVANCE-TO-COLUMN

Reported by: Anton Vodonosov Owned by: Raymond Toy
Priority: major Milestone:
Component: Gray-streams 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:

  1. When we call cl:clear-output for a gray stream, CMUCL calls ext:stream-force-output instead of ext:stream-clear-output
  1. 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 (1)

comment:1 Changed 7 years ago by Anton Vodonosov

Resolution: duplicate
Status: newclosed
Note: See TracTickets for help on using tickets.