Miki Tebeka avatar Miki Tebeka committed 5ee3675

def-

Comments (0)

Files changed (1)

     (map? headers) (vectorize-headers headers)
     (map? record) (vectorize-headers record)))
 
-(defn keyset
+(defn- keyset
   "Return a set of map keys."
   [map]
   (set (keys map)))
 
-(defn unknowns? 
+(defn- unknowns? 
   "Return true if there are any unknown fields in record."
   [record headers]
   (or (> (count record) (count headers))
       (not (subset? (keyset record) (set headers)))))
 
-(defn write-values 
+(defn- write-values 
   "Write values (a line) to a CSV, will flush if *flush?* is true."
   [writer values]
   (.writeRecord writer (into-array String values))
   (when *flush?* (.flush writer)))
 
-(defn gen-formatter [format headers]
+(defn- gen-formatter 
+  [format headers]
   (let [index (if headers #(headers %) identity)]
     (fn [record]
       (keep-indexed #((get format (index %1) str) %2) record))))
 
-(defn sort-record 
+(defn- sort-record 
   "Sort record by headers. Return a sequence of values."
   [record headers]
   (when (unknowns? record headers) (throw (Exception. "unknown fields")))
   (map #(get % record nil) headers))
 
-(defn gen-values 
+(defn- gen-values 
   "Generate values seq from a record."
   [record headers format]
   (when (and (map? record) (nil? headers)) 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.