Thanks guys :-). I didn't know about some and includes?.
On 4/13/10, Stuart Halloway wrote:
> Hi Chris,
>
> includes? is in clojure.contrib.seq. Note that it runs in linear time.
>
> This will feature prominently in the FAQ when I update it. :-)
>
> Stu
>
>> Hi,
>>
>> Is there a standard function
Hi Chris,
includes? is in clojure.contrib.seq. Note that it runs in linear time.
This will feature prominently in the FAQ when I update it. :-)
Stu
Hi,
Is there a standard function to test to see if an object is an
element of a sequence? I'm looking for an equivalent of Haskell's
elem fu
Hi,
On Apr 13, 4:20 pm, Chris Jenkins wrote:
> Is there a standard function to test to see if an object is an element of a
> sequence? I'm looking for an equivalent of Haskell's elem function.
>
> I wrote my own (badly)...
>
> (defn elem? [obj l]
> (if (empty? l)
> false
> (if (= obj (
Hi,
Is there a standard function to test to see if an object is an element of a
sequence? I'm looking for an equivalent of Haskell's elem function.
I wrote my own (badly)...
(defn elem? [obj l]
(if (empty? l)
false
(if (= obj (first l))
true
(elem? obj (rest l)
...but