--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@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+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
| (defn flip "given a function, create a flipped 2-argument function" [f] (fn [a b] (f b a))) (defmacro flop "create a version of a function with a modified arity as specified by a vector of zero-indexed positions, e.g. [0 3 1 2]" [f positions] (let [syms (vec (repeatedly (count positions) gensym))] `(fn [~@syms] (~f ~@(map syms positions))))) |
--