On Tue, Jul 31, 2012 at 7:00 AM, Ben Smith-Mannschott <[email protected]> wrote: > On Tue, Jul 31, 2012 at 1:08 AM, Aaron Cohen <[email protected]> wrote: >> On Mon, Jul 30, 2012 at 6:55 PM, Moritz Ulrich <[email protected]> >> wrote: >>> (some identity ((juxt :k1 :k2) m)) is the first thing I can think of. >> >> For even more fun, try (some m [:k1 :k2]) :) > > The flip side of this proposal is: > > ((some-fn :k1 :k2) m) > > Which takes advantage of the fact that keywords can be called as > functions. That means it will only work for keyword keys, but the > upshot is that it will work for arbitrary functions (not just > keywords) and m need not be a map. > > See also every-pred, which
((my new "truly ergonomic" keyboard is taking some getting used to -- this is the second time I've mashed some keys and ended up sending a gmail message earlier than intended.)) See also every-pred, which complements some-fn. Oh, and see complement too. These three correspond to 'or', 'and' and 'not' respectively. // ben -- 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
