Subject: Re: FORMAT question.
From: rpw3@rpw3.org (Rob Warnock)
Date: Sun, 02 Jan 2005 19:53:19 -0600
Newsgroups: comp.lang.lisp
Message-ID: <UfqdnTFgjqMSOEXcRVn-tA@speakeasy.net>
Svein Ove Aas  <svein.ove@aas.no> wrote:
+---------------
| Svein Ove Aas wrote:
| > (format t
| >    (lambda (s &rest args)
| >      (format s "~{~D~} ~{~D~}"
| >        args
| >        (cdr (reverse args))))
| >     1 2 3 4 'anything 'in 'a 'list)
| 
| The format-string here should of course be
| "~{~D ~}~{~D ~}".
+---------------

I beg to differ! ;-}  That one produces a dangling space at the end.
The correct format string is obviously either:

    "~{~D ~}~{~D~^ ~}"

or if you prefer [for parallelism]:

    "~{~D~^ ~} ~{~D~^ ~}"


-Rob

-----
Rob Warnock			<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607