Created
February 27, 2012 04:22
-
-
Save mattdeboard/1921384 to your computer and use it in GitHub Desktop.
How to macro?
This file contains 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
(def connectors {:or " OR " | |
:and " AND " | |
:not " NOT "}) | |
(defn -| [coll] | |
(paren-wrap | |
(apply str (interpose (:or connectors) | |
(map build-querystring coll))))) | |
(defn -& [coll] | |
(paren-wrap | |
(apply str (interpose (:and connectors) | |
(map build-querystring coll))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment