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



Peter Seibel wrote:
Vladimir Zolotykh <gsmith@xxxxxxxxxxxxx> writes:


The following simple function
(defun foo (n)
  (let* ((*print-right-margin* n)
	 (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)))
if called (cl-user::foo 10)
prints one word at a line. So does (cl-user::foo 20),30,40.
And only (cl-user::foo 50) prints

Whan you're lost in the Wild, and you're scared
as a child, And Death looks you bang in the eye,

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?


I'm sure I don't actually understand this but poking around a bit I
came up with this:

  (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)))
Yes, it's kikd of a mistery.
I sure understand less then nothing in the HyperSec section for
*PRINT-MISER-WIDTH*, what's the "miser style" of output mentioned there?


-Peter



--
Vladimir Zolotykh
.



Relevant Pages