home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dove!cme!kramer
- From: kramer@cme.nist.gov (Tom Kramer)
- Newsgroups: comp.lang.lisp
- Subject: Re: Use of format or pprint
- Message-ID: <20483@cosmos.cme.nist.gov>
- Date: 24 Dec 92 17:13:19 GMT
- References: <1992Dec17.173558.18552@grace.boeing.com>
- Distribution: usa
- Organization: National Institute of Standards and Technology, Gaithersburg, MD
- Lines: 29
-
- In article <1992Dec17.173558.18552@grace.boeing.com> ski@atc.boeing.com writes:
-
- >(setq a "org")
- >(setq b
- > "chris dan ski elaine nick tony charlie jeff jeffw bruce mike kim kelly")
- >or (setq b '("chris" "dan" "ski"...))
- >
- >What format string
- >(format "???" a b)
- >will print them in this format
- >
- >org: chris dan ski elaine nick tony charlie
- > jeff jeffw bruce mike kim kelly
-
- Using (setq b '("chris" "dan" "ski" ...)) the following works
-
- (format t "~A:~{~8T~A~^ ~A~^ ~A~^ ~A~^ ~A~^ ~A~^ ~A~^~%~}" a b)
-
- The first ~A uses up a.
- The ~{...~} is processed repeatedly on elements of b until all are used.
- The 8T gets to the correct column.
- The ~^ are so processing will stop without error regardless of the
- length of b.
-
- I wasted an hour on that, but I learned something. Merry Christmas!
- This worked in Allegro Common LISP on a SUN4.
-
- Tom Kramer
- kramer@cme.nist.gov
-