Re: FORMAT ~<...~:@> PUZZLE
- From: "Geoffrey Summerhayes" <sumrnot@xxxxxxxxxxxxxxxxx>
- Date: Tue, 29 Nov 2005 23:35:22 -0500
"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
.
- References:
- FORMAT ~<...~:@> PUZZLE
- From: Vladimir Zolotykh
- Re: FORMAT ~<...~:@> PUZZLE
- From: Geoffrey Summerhayes
- Re: FORMAT ~<...~:@> PUZZLE
- From: Peter Seibel
- Re: FORMAT ~<...~:@> PUZZLE
- From: Geoffrey Summerhayes
- Re: FORMAT ~<...~:@> PUZZLE
- From: Peter Seibel
- FORMAT ~<...~:@> PUZZLE
- Prev by Date: Re: OT to the extreme [Was Re: I'm working on yet another license]
- Next by Date: Re: sanity check (coding style)
- Previous by thread: Re: FORMAT ~<...~:@> PUZZLE
- Next by thread: Reddit Guys on the Pros and Cons of Lisp
- Index(es):