[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Issue: STREAM-INFO (Version 4)
- To: Masinter.pa@xerox.com
- Subject: Issue: STREAM-INFO (Version 4)
- From: dick@wheaties.ai.mit.edu (Richard C. Waters)
- Date: Mon, 27 Jun 88 11:35:44 EDT
- Cc: KMP@stony-brook.scrc.symbolics.com, CL-Cleanup@sail.stanford.edu
- In-reply-to: Masinter.pa@xerox.com's message of 23 Jun 88 00:53 PDT <880624-114259-5815@Xerox>
"Returns the current horizontal position of the cursor..."
The word "cursor" is unfortunately overused and not defined here or
elsewhere in CLtL.
Cursor is indeed a vague word. Perhaps we could just say THAT
"OUTPUT-POSITION returns the total net width of all of the
characters written to the stream since that last <newline> character
(or since the creation of the stream if no <newlines> have ever been
written).
What is (with-output-to-string (x) (princ "a test") (output-position x))?
Is it implementation dependent?
There is really a key point here. Yes it is implementation dependent.
In particular, the values returned cannot be used for anything but
comparing with each other. For example, if the output-width is not
nil, then the value of output-position can be compared with it to
determine how close you are to the end of the line (in percent, but
not by any absolute measure.) [With a string-stream the logical
output-width is assumedly nil.]
Another use of output-position is that no matter what number
output-position returns, sending a <newline> to the stream and then
calling output-space with the same number will get you back to the
same horizontal place.
The proposal is carefully crafted to give you these two capabilities
while adding as few other constraints as possible.
----------------------------------------------------------------------
NOTE, a broadcast stream must keep track of the relationships between
the units of width used by the actual target streams so that
output-space requests can be translated correctly when they are
broadcast to all of the actual targets.
Dick