Frank Buss <fb@frank-buss.de> wrote:
+---------------
| Ken Tilton wrote:
| > Jeez, all I want to do is output data tab-delimited, can I use \t in a
| > string? no. Does ~t emit a tab? No. Does anything? No. I have to:
| > (format clean "~&~{~a~^~c~}" (loop for f in fields
| > nconc (list f #\tab)))
+---------------
[Minor trivia: "COLLECT F COLLECT #\Tab" probably conses less
than "NCONC (LIST F #\Tab)".]
+---------------
| Your editor sucks! If I didn't overlooked something in the CLHS,
| there is no limitation for the characters you can include in
| strings, e.g. newlines or tabs:
|
| CL-USER > (format t "~{~A~^
| ~}" '(lisp rules !))
| LISP
| RULES
| !
|
| CL-USER > (format t "~{~A~^ ~}" '(lisp rules !))
| LISP RULES !
|
| (note: for this usenet posting I have converted tabs to spaces and the
| space in the format string between ^ and ~ should be a tab)
+---------------
I sometimes use recursive FORMATs for this sort of thing:
> (format t
(format nil "~a~c~a" "~{~a~^" #\tab "~}")
'(lisp rules !))
LISP RULES !
NIL
>
And, yes, I know it could have been done in the following way,
but IMHO that would be even uglier and less maintainable:
> (format t
(format nil "~~{~~a~~^~c~~}" #\tab)
'(lisp rules !))
LISP RULES !
NIL
>
-Rob
-----
Rob Warnock <rpw3@rpw3.org>
627 26th Avenue <URL:http://rpw3.org/>
San Mateo, CA 94403 (650)572-2607