Created
February 27, 2013 16:22
-
-
Save dcolish/5049199 to your computer and use it in GitHub Desktop.
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
(defn write-builder [cube & ats] | |
(reduce (fn [builder [dim value]] (doto builder (.at dim value))) | |
(WriteBuilder. cube) | |
(filter #(not (empty? %)) ats))) | |
(defn read-builder [cube & ats] | |
(reduce (fn [builder [dim bucket value]] (doto builder (.at dim bucket value))) | |
(ReadBuilder. cube) | |
(filter #(not (empty? %)) ats))) | |
(defmacro io-builder [klazz cube & ats] | |
`(reduce (fn [builder# x#] (doto builder# (.at x#)) | |
(new ~klazz ~cube) | |
[~@ats])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment