From: Nicolas Rouquette
Subject: format control string.
Date: 
Message-ID: <2oujvf$ju9@overcat.jpl.nasa.gov>
(format t "begin~{~<end~%begin~1,20:; ~d~>~^,~}" '(1 2 3 4 5 6 7 8 9 10))

produces:

begin 1, 2, 3, 4, 5,end
begin 6, 7, 8, 9,end
begin 10

However, what I'd like is:

begin 1, 2, 3, 4, 5 end
begin 6, 7, 8, 9 end
begin 10 end

Anybody knows the right format control incantation to do this?
-- 
Nicolas Rouquette                      Artificial Intelligence Group
Email: ········@aig.jpl.nasa.gov       Jet Propulsion Laboratory, M/S 525-3960
Phone: (818) 306-6916                  4800 Oak Grove Dr.
  Fax: (818) 306-6912                  Pasadena, CA 91109
From: Barry Margolin
Subject: Re: format control string.
Date: 
Message-ID: <2p0vcrINNfq5@early-bird.think.com>
In article <··········@overcat.jpl.nasa.gov> ········@overcat.jpl.nasa.gov (Nicolas Rouquette) writes:
>(format t "begin~{~<end~%begin~1,20:; ~d~>~^,~}" '(1 2 3 4 5 6 7 8 9 10))
...
>However, what I'd like is:
>
>begin 1, 2, 3, 4, 5 end
>begin 6, 7, 8, 9 end
>begin 10 end

I don't think this can be done only with FORMAT.  The iteration and
justification controls don't communicate with each other, so there's no way
to make ~^ treat the wrapping iterations specially.  It only special-cases
the last iteration of all.

The best way to do this, I think, is to format into a string and add the
commas and begin/end's yourself.
-- 
Barry Margolin
System Manager, Thinking Machines Corp.

······@think.com          {uunet,harvard}!think!barmar