Hi,

Does this work for you?

(remove #{:a} [:a :b :a :c :d :e])

Also, if you have a list of items you can have all of them in the same
set/predicate like so -

(remove #{:a :z :x} [:a :b :a :c :d :e :z :b :d :e :x :z])

Hope this helps.

Regards,
BG

On Thu, Aug 9, 2012 at 10:11 AM, Jason Long <jsnl...@gmail.com> wrote:
> I am trying to remove every occurrence of a given element from a vector.  I
> can use (filter #(== % a) v) where 'a' is the value to be removed and 'v' is
> the vector, but this returns 'a' and 'a' is the value i want to remove. So,
> how can i do this? I tried replacing 'filter' with 'remove' but it didn't
> like that. Also, can anyone tell me why != is not included for equality
> testing, that would make this problem easy.
>
> Thanks, Jason.
>
> P.S. I also need to be able replicate the problem, but instead of removing a
> single item from the vector, I need to remove a list of items from the
> vector. I know I'm going to have to do some looping or recursing, but any
> help would be appreciated. Thanks
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en



-- 
Baishampayan Ghose
b.ghose at gmail.com

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to