Created
April 23, 2011 04:16
-
-
Save jColeChanged/938272 to your computer and use it in GitHub Desktop.
A Nifty Clojure Function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn fn-and | |
"Takes a set of functions and returns a fn which returns whether | |
every item in the juxtaposition of those functions is true." | |
([& fns] | |
(let [juxted-fns (apply juxt fns)] | |
(fn [& args] (every? true? (apply juxted-fns args)))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment