<div>Hi ALL,</div>
<div> </div>
<div>I have this code</div>
<div> </div>
<div>(define test <br> (lambda (x v) <br> (define helper <br> (lambda (ls) <br> (cond <br> ((empty? ls) '()) <br> ((empty? (rest ls)) '()) <br>
((equal? (second ls) x) (cons (first ls) (helper (rest ls)))) <br> (else (helper (rest ls)))))) <br> (helper (vector->list v)))) </div>
<div> </div>
<div>When I run it with </div>
<div>> (test 'a #(b a c a))</div>
<div>it returns<br>'(b c)</div>
<div> </div>
<div>Is there a way to use the list such as (test 'a '(b a c a))? I tried to delete vector->list from the last line of the code, but it did not work. Why?</div>
<div> </div>
<div>Thanks a lot</div>