[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Is justification random?



I wanted to use format to lay out some column headers like this:

|  xxx |  xxx |  xxx | ...
|  yyy |  yyy |  yyy | ...

I assumed that the ~<...~> format directives would fit the bill.  When
I tried it on VaxLisp, I discovered that their FORMAT randomizes the
dispersion of whitespace (their code actually calls a random number
generator).  Their rationale is that doing so will prevent whitespace
from clumping on the left if ~<...~> were used to put out a paragraph
of text.

The Symbolics CL does not randomize, it inserts spaces from left to
right.  I guess their rationale (really mine) is that it makes column
header layout work right (a much more common use of ~<...~>).

CLtL is ambiguous.  It merely says "the spacing is evenly divided
between the text segments" (pg. 404)

Here is a brief test case:

(dotimes (i 10) (format t "~&~3:<x~;|~>"))

On the Vax, the x is not in the same column each time.  On the SCL it
is.

I think the behavior of ~<...~> should be standardized and I vote
against randomization.

	-- Nick