输入:
List of keys: [ :name :address :work]
Map 1: { :name "A" :address "A Street" }
Map 2: { :work "Work Ave" }
输出:
([:name "A" nil] [:address "A Street" nil] [:work nil "Work Ave"])
这就是我目前所拥有的:
(defn maps-iterate [v & ms]
(map (fn [k] (into [] [k #(map (k %) ms)])) v))
(println (maps-iterate [ :name :address :work ] { :name "A" :address "A Street"} { :work "Work Ave" }))
这给了我:
([:name #<user$maps_iterate$fn__2$fn__3 user$maps_iterate$fn__2$fn__3@4b14b82b>]
[:address #<user$maps_iterate$fn__2$fn__3 user$maps_iterate$fn__2$fn__3@3d47358f>]
[:work #<user$maps_iterate$fn__2$fn__3 user$maps_iterate$fn__2$fn__3@e0d5eb7>])