I am trying to write a generic serialization function in clojure. Something like that
(def input-map {:Name "Ashwani" :Title "Dev"}) (defn serialize [input-map delimiter] ...rest of the code )
What when calling
(serialize input-map ",") Produces Ashwani,Dev
I have something at the moment that needs certain card keys, but does it
(defn serialize [input-map] (map #(str (% :Name) "," (% :Title) "\n") input-map ) )
What I want to avoid is the name and the name of hardcoding. There must be some way to use reflection or do something for this, but unfortunately I don't know enough clojure to do this.
source share