Re: FORMAT ~<...~:@> PUZZLE




"Peter Seibel" <peter@xxxxxxxxxxxxxxx> wrote in message news:m2irubum5v.fsf@xxxxxxxxxxxxxxxxxx
> "Geoffrey Summerhayes" <sumrnot@xxxxxxxxxxx> writes:
>> Realized after posting I should have included that...
>>
>> (defun foo (n)
>> (let ((*print-right-margin* n)
>> (*print-miser-width* nil)
>> (a '("Whan" "you're" "lost" "in" "the" "Wild,"
>> "and" "you're" "scared" "as" "a" "child,"
>> "And" "Death" "looks" "you" "bang"
>> "in" "the" "eye,")))
>> (format t "~@<~{~A~^ ~:_~}~:@>" a)))
>
> So it seems to me that with *PRINT-MISER-WIDTH* set to NIL you don't
> need the ~:_ at all.

>From the CLHS:

If ~:@> is used to terminate the directive (i.e., ~<...~:@>),
then a fill-style conditional newline is automatically
inserted after each group of blanks immediately contained
in the body (except for blanks after a <Newline> directive).

Unfortunately there appears to be more than one way of
interpreting 'immediately'. Most Lisps, AFAIK, take it
to mean all spaces found between ~< and ~:@> but LW
appears to take it as 'top-level' spaces leaving the
spaces between the ~{ ~} unchanged. I tested on LW
Personal 4.4.6 Whether it's a bug or not, I'll leave
to the language lawyers.

--
Geoff


.