Hi all,<br>here more than three hours that i'm locked on a function, i defer to you =)<br>My problem : i have a list of vectors, each vectors represents a text syntax (not html syntax, just text), and were created with the result of a format sqlite SELECT operation.<br>
<br>For example, my list of vectors L is like this :<br>(define L '(#("nickname || ' ( ' || date || ' )' || content") <br> #("zobi ( Thursday, October 14th, 2010 12:40:51pm ) <p>try</p>") <br>
#("zf ( Thursday, October 14th, 2010 12:43:56pm ) (a ((href \"foo.html\")) \"sometext\")")<br> #("zf2 ( Thursday, October 14th, 2010 12:44:59pm ) (a ((href \"bar.html\")) \"anotherone\")")))<br>
<br>So, (first L) is a vector, (second L) too, etc.<br>Now, i want to replace each string, for example "Thursday", by "<<Thursday>>", in my list of vectors.<br><br>I have created a function, wich i call like this :<br>
(rush! L '() "Thursday")<br><br>this is the function :<br>(define (rush! T super-list a-string)<br> (if (empty? T)<br> super-list ;; here is the problem<br> (rush! (rest T)<br> (append<br>
super-list<br> (list (regexp-replace* a-string (vector-ref (first T) 0) (string-append "<<" a-string ">>"))))<br> a-string)))<br><br>Now, if i compare L and (rush! L '() "Thursday"), i have for L:<br>
'(#("nickname || ' ( ' || date || ' )' || content")<br> #("zobi ( Thursday, October 14th, 2010 12:40:51pm ) <p>try</p>")<br> #("zf ( Thursday, October 14th, 2010 12:43:56pm ) (a ((href \"foo.html\")) \"sometext\")")<br>
#("zf2 ( Thursday, October 14th, 2010 12:44:59pm ) (a ((href \"bar.html\")) \"anotherone\")"))<br><br>and for the function :<br>'("zobi ( <<Thursday>>, October 14th, 2010 12:40:51pm ) <p>try</p>"<br>
"zf ( <<Thursday>>, October 14th, 2010 12:43:56pm ) (a ((href \"foo.html\")) \"sometext\")"<br> "zf2 ( <<Thursday>>, October 14th, 2010 12:44:59pm ) (a ((href \"bar.html\")) \"anotherone\")")<br>
<br>BUT it's not a list of vectors, it's a simple list ...<br>Instead of <br> (if (empty? T) super-list ...<br>i've tried (if (empty? T) (list->vector super-list) ... mamamia, it's no a list of vectors, but just a simple vector ...<br>
<br>I really don't know how i can replace a-string into a list of vectors so, because my rush! function doesn't works like i want ...<br><br>Thank you for your help,<br>-mw<br>