On Wed, Sep 15, 2010 at 2:48 PM, Michael Ossareh <ossa...@gmail.com> wrote:
> Hi Guys,
>
> One of the things that has struck me about clojure, by virtue of being
> a lisp, is the concision of the code - I really find it very
> attractive. However yesterday I found something that I couldn't work
> out how to do in a concise manner. Clearly commenting the code was a
> priority once I got it working, however I'd like to ensure I'm doing
> this correctly.
>
> Much of my functional experience comes from JS and dealing with the
> immutability of our data structures is a very interesting learning
> process.


You should look at update-in, assoc-in. Then you could write something like
this (not tested):

(defn add-meeting [xs key meeting]
 (for [x xs]
   (update-in x [key :meetings] conj meeting)))

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

Reply via email to