|
From: Bruno H. <br...@cl...> - 2005-06-06 20:56:26
|
David Tolpin wrote:
> 1) is it a design decision or omission that char_width('\t') returns
> zero because #\Tab is not a graphical character? (charstrg.d)
It's more because no result can be right for #\Tab. For comparison, the
POSIX function wcwidth returns
wcwidth('\t') = -1
where -1 means "don't know". But for char_width, the value is used to
compute string sizes in the pretty-printer. You can't really handle
Tab characters there.
> 2)
>
> > fresh-line is similar to terpri but outputs a newline only if the
> > output-stream is not already at the start of a line. If for some
> > reason this cannot be determined, then a newline is output anyway.
> > fresh-line returns true if it outputs a newline; otherwise it returns
> > false.
>
> is it your reading of the specification that writing the #\Tab
> character to the output stream determinately keeps the output-stream at
> the start of a line?
No. But any other value would be just as wrong. 8 would be wrong on Windows,
4 or 2 would be wrong on Unix. And it depends on the settings of the terminal
(xterm or so).
FRESH-LINE just tests the whether the value is 0. But the pretty-printer
is highly interested in the magnitude, and since you cannot get this right,
it doesn't really matter what FRESH-LINE does in this context.
I'd recommend to just avoid the tabs. FORMAT ~nT outputs enough spaces to
get to column n; therefore you don't need tabs.
Bruno
|