I think you might find the following blog post helpful:
http://blog.jayfields.com/2011/01/clojure-select-keys-select-values-and.html

What you are asking for is basically (clojure.string/join (select-values
my-map vals)) where select-values is defined in several ways in the linked
blog post.

For code golf points, the briefest example from the blog that would work
for your purposes might be:

(defn select-values [m ks] (map m ks))

So:

user=> (def my-map { :name "roelof", :city "big-secret" })

user=> (clojure.string/join ", " (map my-map [:name :city]))
"roelof, big-secret"


On Fri, Oct 23, 2015 at 7:49 AM, r/ Wobben <wobbe...@gmail.com> wrote:

> Hello,
>
> As a challenge I need to convert a map structure to a csv structure.
>
> So ( { :name "roelof", :city secret }) need to be converted to roelof,
> secret.
>
> I think I can use something like (map clojure.string/join  ..) for it but
> it seems I have to make a function out of the :name roelof part to get
> roelof back.
>
> I could use  get for then I do not know how to call 1 records of the whole
> map.
>
> Can someone explain in simple English how I can solve this one ?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to