develooper Front page | perl.perl6.language | Postings from February 2004

Exegesis 7: Fill Justification

Thread Next
Gregor N. Purdy
February 28, 2004 07:18
Exegesis 7: Fill Justification
Message ID:
In the section "He doth fill fields..." we see an example of Fill
Justification where two spaces fit between every word. This doesn't
give us an idea of how spaces are distributed if the number of
spaces needed does not divide evenly into the number of interstices.

In the section "More particulars must justify my knowledge...",
indicates the approach is to "...distribute any padding as evenly
as possible into the existing whitespace gaps...", but still doesn't
tell us what the rule really is. In the example, there are two
spaces to be distributed and three interstices. The last two each
get one space. That could be the "add one pad to each insterstice
from right to left, repeat until exhausted" rule, which isn't really
about even distribution.

One other note about this example: The text says C<form> will
"...extract a maximal substring...", but in the example that string
would be "A fellow of infinite j". The example output shows that the
extracted string isn't quite maximal. It tries to keep words together
(this rule is detailed elsewhere, but this example doesn't refer to
that extraction rule).

Gregor Purdy                  
Focus Research, Inc.     

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About