On Thu, Aug 9, 2012 at 10:11 AM, Jason Long wrote:
> Also, can anyone tell me why != is not included for equality testing, that
> would make this problem easy.
To answer your other question, != in Clojure is called not=
Regards,
BG
--
Baishampayan Ghose
b.ghose at gmail.com
--
You received t
To clarify Baishampayan's code, hash-sets in Clojure are functions:
=> (#{1} 1)
1
=> (#{1} 2)
nil
Nil and false in Clojure are the same thing,
So Baishampayan's example:
(remove #{:a :z :x} [:a :b :a :c :d :e :z :b :d :e :x :z])
#{:a :z : x} will return nil if the value is not in the vector,
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 w
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