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)))
Retarded language!
kzo
Ken Tilton <···········@optonline.net> writes:
> 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)))
>
> Retarded language!
You can put the tab into the format string, "~&~{~A ~}", or if you
want the tab to be visible, perhaps,
(format t #.(concatenate 'string "~&~{~A~^" (string #\Tab) "~}") '(a b c))
--
RmK
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)))
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)
--
Frank Buss, ··@frank-buss.de
http://www.frank-buss.de, http://www.it4-systems.de
Frank Buss 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)))
>
>
> Your editor sucks!
Ah, just had to use a special command to insert the tab.
thx,kt
Frank Buss <··@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.org>
627 26th Avenue <URL:http://rpw3.org/>
San Mateo, CA 94403 (650)572-2607
Ken Tilton <···········@optonline.net> 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)))
CL-INTERPOL <http://weitz.de/cl-interpol/> could help.
> Retarded language!
More a demented language. :-)
--
Web (en): http://www.no-spoon.de/ -*- Web (de): http://www.frell.de/
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)))
The hairier the better... ;)
(format clean "~&~{~A~^~C~}" (mapcan #'list fields '#1=(#\Tab . #1#)))
without FORMAT:
(let ((s1 (catenate #Z(0) (series 1)))
(s2 (#M princ-to-string (scan fields))))
(collect-append 'string (spread s1 s2 '(#\Tab))))
Just wasting electrons...