Re: nested maps

2009-01-29 Thread Christian Vest Hansen
On Wed, Jan 28, 2009 at 10:31 PM, Vincent Foley wrote: > > (-> person :employer :address :city) would be my pick I tend to prefer this method as well. I find that doto and -> in general are excellent tools for picking apart and poking nested structures. > > Vincent > > On Jan 28, 4:02 pm, Mark

Re: nested maps

2009-01-28 Thread Chouser
On Wed, Jan 28, 2009 at 4:02 PM, Mark Volkmann 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 chan

Re: nested maps

2009-01-28 Thread Vincent Foley
(-> person :employer :address :city) would be my pick Vincent On Jan 28, 4:02 pm, Mark Volkmann wrote: > I have a map that describes a person. > It has a key that describes their address. > It also has a key for their employer. > The employer has its own address. > > (def person { >   :name "Ma