Hi, Am 18.10.2009 um 09:48 schrieb Dmitry Kakurin:
> Here is what I have right now: > (let [idata ... something ... > sales > (filter > #($ (% "Product Type Identifier") = "1" && > % "Vendor Identifier" = "01010012" > ) > idata > ) > upgrades > (filter > #($ % "Product Type Identifier" = "7" && > % "Vendor Identifier" = "01010012" > ) > idata > ) > demo > (filter > #($ % "Product Type Identifier" = "1" && > % "Vendor Identifier" = "01010318" > ) > idata > ) > ] > (println "Sales : " (sum-units sales)) > (println "Upgrades: " (sum-units upgrades)) > (println "Demo : " (sum-units demo)) Maybe you can do: (reduce (fn [[sales upgrades demo :as v] data] (cond (is-sales? data) [(conj sales data) upgrades demo] (is-upgrade? data) [sales (conj upgrades data) demo] (is-demo? data) [sales upgrades (conj demo data)] :else v)) [[] [] []] (get-idata)) This will hold the resulting collections completely in memory, but not the idata part. This is maybe not what you want, because it's too big. Or it is what you want, because you want to close the file at some point in time. I think defining anything lazy will hold onto idata. (or at least part of the end results) Sincerely Meikel
smime.p7s
Description: S/MIME cryptographic signature