Mathias,

I wrote a short article about building more complex reduce functions 
here[1].  I wrote it mostly to reinforce my own knowledge.  The bottom 
section will be most relevant to you.

Hope it helps,
Jarrod

[1]: http://jarrodswart.com/articles/clojure-tutorial-reduce-functions

On Friday, December 12, 2014 5:07:58 AM UTC-5, Mathias Picker wrote:
>
> Hi all,
>
> a short question from a newbie. I have a data structure like:
>
> "mytitle1"; "2015-02-01"
> "mytitle2"; "2015-03-12"
> "";2015-03-28"
> "mytitle3; "2015-01-12"
>
> and want something like this
>
> [{:title "mytitle1" :events [{:date "2015-02-01}]}
>  {:title "mytitle2" :events [{:date "2015-03-12"} {:date "2015-03-28"}]}
>  {:title "mytitle3" :events [{:date "2015-01-12"}]}]
>
> I can recurse through the csv manually, but I have a dim feeling this 
> might be a job for reduce, but can't wrap my head around it...
>
> Can anyone give me a hint if and how this could be done? Or just tell me 
> that I'm mistaken?
>
> If I'm wrong about reduce, anything which uses part of the standard lib to 
> make this a more elegant solution would be interesting.
>
>
> Thanks,
>
> Mathias
>

-- 
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