Subject: Re: format directive "~{...~}"
From: Erik Naggum <erik@naggum.no>
Date: 2000/01/10
Newsgroups: comp.lang.lisp
Message-ID: <3156500787965612@naggum.no>

* "David J. Cooper" <dcooper8@genworks.com>
| Now I am wondering if there is a way to use this or a similar directive
| to put something before all but the first element in the list, as in:
:
| that is, I want an extra space *before* all but the *first*  element in
| the argument list, so that the rest of the elements line up under the
| first one which has a parenthesis to the left of it.

  PPRINT-LOGICAL-BLOCK can handle this requirement easily.  its FORMAT
  interface is documented in section 22.3.5.2 of the standard.

  for a list like (one two three) to be formatted nicely, this suffices:

(format nil "~:<~@{~S~^~:@_~}~:>" '(one two three))

  untangling this example is left as an exercise for the reader...
  
#:Erik