Try merge-with to create a single map.

On Jul 5, 1:49 pm, "Bhinderwala, Shoeb" <sabhinderw...@wellington.com>
wrote:
> I need help to write a small filtering function. Given the following
> definitions:
>
> (def m1
>        {["45"] {:a 45 :b "day1"}
>         ["55"] {:a 55 :b "day1"}
>         ["25"] {:a 25 :b "day1"}
>         ["15"] {:a 15 :b "day1"}
>         ["10"] {:a 10 :b "day1"}})
>
> (def m2
>        {["45"] {:a 45 :b "day2"}
>         ["55"] {:a 55 :b "day2"}
>         ["25"] {:a 25 :b "day2"}
>         ["15"] {:a 15 :b "day2"}
>         ["10"] {:a 10 :b "day2"}})
>
> (def m3
>        {["45"] {:a 45 :b "day3"}
>         ["55"] {:a 55 :b "day3"}
>         ["25"] {:a 25 :b "day3"}
>         ["15"] {:a 15 :b "day3"}
>         ["10"] {:a 10 :b "day3"}})
>
> (def d (list m1 m2 m3))
>
> I need to write a function that returns the filtered results as follows:
>
> (my-filter d ["45"])
> => ({:a 45 :b "day1"} {:a 45 :b "day2"} {:a 45 :b "day3"})
>
> Thanks for your help.
>
> -- Shoeb

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