On Fri, Jan 20, 2012 at 9:54 PM, drewn <naylor...@gmail.com> wrote: > I've been trying to write a macro to generate predicates from maps, > for instance the map {1 :one 2 :two} would define two predicates, one? > and two?
What's the use case for this? (def one? #{1}) (def two? #{2}) isn't much worse. I suppose a macro to emit those might be useful, though I'd probably put the fn-names first in each pair; something like (defmacro specific-thing-preds [& kvs] `(do ~@(map (fn [[k v]] `(def ~k #{~v})) (partition 2 kvs)))) (specific-thing-preds one? 1 two? 2) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en