如果我有这样的收藏
Diters
如何制作函数,使其仅返回{{:A "a" :B "b"} {:A "a" :B "Goal" } {:A "a" :B "Goal"}}
的部分?仅含义:
:B "Goal"
答案 0 :(得分:6)
我修复了您的数据,使其成为3张地图的矢量。
(def data [{:A "a" :B "b"}
{:A "a" :B "Goal"}
{:A "a" :B "Goal"}])
(defn b-goal?
[item]
(= (:B item) "Goal") )
(filter b-goal? data) => ({:A "a", :B "Goal"} {:A "a", :B "Goal"})
请确保还签出:
以及
之类的书