My poor brain can't handle nested calls to update-in, so this is what I came up with:
(defn add-meetings [data k meetings] (cond (nil? (data k)) (assoc data k {:title "title" :meetings meetings}) :else (update-in data [k :meetings] concat meetings))) On Sep 16, 8:53 am, Laurent PETIT <laurent.pe...@gmail.com> wrote: > 2010/9/16 Meikel Brandmeyer <m...@kotka.de> > > > Hi Laurent, > > > On 16 Sep., 15:54, Laurent PETIT <laurent.pe...@gmail.com> wrote: > > > > you don't like my one-liner ? :-) > > > I saw your message only after I sent mine. :) > > > > (update-in coll [k] (fnil update-in *default-value*) [:meetings] (comp > > vec > > > concat) data) > > > Hmm... (comp vec concat) == into? > > Yep. > so this is the killer one : :-) > > (update-in coll [k] (fnil update-in *default-value*) [:meetings] into data) -- 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