On Wed, Jan 28, 2009 at 4:02 PM, Mark Volkmann
<r.mark.volkm...@gmail.com> wrote:
>
> Is this the best way to retrieve the employer city?
> (reduce get person [:employer :address :city])

That's the definition of 'get-in', but the -> suggestion sounds good too.

> Is this the best way to get a new map where the city is changed?
> (update-in person [:employer :address :city] (fn [old & args] "Clayton"))
> I can't get this to work with #("Clayton") in place of the anonymous
> function above.

You might like 'assoc-in' for this use case.

--Chouser

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