Hi,
Am 23.07.2010 um 23:27 schrieb .Bill Smith:
> (filter #(and (f %) (g %) (h %)) my-list)
Here a completely different approach. Note, it also preserves short-circuiting.
(defn and-pred
[& preds]
(if-let [preds (seq preds)]
(fn [x]
(seq (drop-while identity (map #(% x) preds))))
(constantly true)))
(filter (and-pred f g h) my-list)
However, I like ataggart's macro the most so far. It's pretty straightforward.
Sincerely
Meikel
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en