<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
Update to my previous post, I missed a ` character (just ran it to make
sure I was sane). The line is actually:<br>
<br>
(list `#(,(regexp-replace* a-string (vector-ref (first T) 0)
(string-append "<<" a-string ">>")))))<br>
<br>
Thanks,<br>
-Everett<br>
<br>
On 10/18/2010 03:23 PM, scouic wrote:
<blockquote
cite="mid:AANLkTi=mK0USsTcknHbgPT94FysC8iqMV5bcm4Z_b5ke@mail.gmail.com"
type="cite">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>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_________________________________________________
For list-related administrative tasks:
<a class="moz-txt-link-freetext" href="http://lists.racket-lang.org/listinfo/users">http://lists.racket-lang.org/listinfo/users</a></pre>
</blockquote>
</body>
</html>