On Apr 30, 2009, at 1:50 PM, samppi wrote:

I know there's a core function that takes a predicate and returns its
opposite:

(defn mystery [predicate]
(fn [x] (not (predicate x))))

I'm having a lot of trouble finding the name of it in the docs,
though. Could anyone give me its name? Or does this function not exist
in the core?


Is this the one you're thinking of?

user=> (find-doc "opposite")
-------------------------
clojure.core/complement
([f])
 Takes a fn f and returns a fn that takes the same arguments as f,
 has the same effects, if any, and returns the opposite truth value.
nil
user=>

--Steve

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to