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



"Geoffrey Summerhayes" <sumrnot@xxxxxxxxxxx> writes:

> Vladimir Zolotykh wrote:
>
>> What's wrong? I'd expect that calls with n less that 50 (e.g 20, 30, 40)
>> would also print _formatted_ paragraph. Where was I wrong?
>
> Try:
>
> (format t "~@<~{~A~^ ~:_~}~:@>" a)))
>
> CL-USER 2 > (foo 10)
> Whan
> you're
> lost in
> the Wild,
> and
> you're
> scared as
> a child,
> And Death
> looks you
> bang in
> the eye,
> NIL

What's the value of *print-miser-width*? Because if I have it set to
something non NIL that doesn't help. In fact it makes it worse (see below).

>From the docs for pprint-newline:

Talking about :fill which is what you get with ~:_

"if miser style is in effect, fill-style conditional newlines act
like linear-style conditional newlines."

And talking about :linear style:

"line breaks are either inserted at every linear-style conditional
newline in a logical block or at none of them."

Which is what I see when the thing is printed in miser-mode:

CL-USER> *print-miser-width*
40
CL-USER> (foo 10)
Whan

you're

lost

in

the

Wild,

and

you're

scared

as

a

child,

And

Death

looks

you

bang

in

the

eye,
NIL
CL-USER>
--
Peter Seibel * peter@xxxxxxxxxxxxxxx
Gigamonkeys Consulting * http://www.gigamonkeys.com/
Practical Common Lisp * http://www.gigamonkeys.com/book/
.



Relevant Pages

  • Re: FORMAT ~<...~:@> PUZZLE
    ... the Wild, ... Whan you're lost in ... child, And Death ...
    (comp.lang.lisp)
  • Re: FORMAT ~<...~:@> PUZZLE
    ... > (defun foo (n) ... > Whan you're lost in the Wild, ...
    (comp.lang.lisp)
  • Re: OT:Kudos to Aussie Foreign Minister
    ... It's odd that such a concentration of educated minds could ... Did you notice the "lost his nerve/stabbed in the back/not ... And with a parliamentary system, they won't have to wait for ... Yeah, it can get wild. ...
    (rec.audio.opinion)
  • Re: The Bravery of Madness
    ... spit from a wild ... Lost of meaning ...
    (rec.arts.poems)
  • Re: ListBox
    ... lost it 's wild thoughts were released on ... Vulcans always have a point and that is not just earsay. ... (Vlad Lenin) ...
    (microsoft.public.vb.general.discussion)