Hi ALL,

I have this code

(define test
  (lambda (x v)
    (define helper
      (lambda (ls)
        (cond
          ((empty? ls) '())
          ((empty? (rest ls)) '())
          ((equal? (second ls) x) (cons (first ls) (helper (rest
ls))))
          (else (helper (rest ls))))))
   (helper (vector->list v))))

When I run it with
> (test 'a #(b a c a))
it returns
'(b c)

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?

Thanks a lot
_________________________________________________
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users

Reply via email to