You can first capture the variable names and their values into a map:
(defmacro name-map [& xs] (let [args-list# (cons 'list (map (juxt (comp keyword str) identity) xs))] `(into {} ~args-list#)))
If you pass the var names to the macro,
(let [aa 11 bb 22 cc 33] (name-map aa bb cc))
It gives you a map which you can then use for any further processing:
=> {:aa 11, :bb 22, :cc 33}(def result *1)(run! (fn [[k v]] (println (str "spit file_" (name k) " value: " v))) result)=>spit file_aa value: 11spit file_bb value: 22spit file_cc value: 33
Edit: Just noticed it's similar to Taylor's macro. The difference is this one works with primitive types as well, while Taylor's works for the original data (vars resolving to collections).