我的地图功能给我输出:
([[:db/retract 1 :a 23] [:db/retract 1 :b 34]] [[:db/retract 2 :v 45] [:db/retract 2 :o 89]] [[:db/retract 4 :l 6]])
但我想要这些:
([[:db/retract 1 :a 23] [:db/retract 1 :b 34] [:db/retract 2 :v 45] [:db/retract 2 :o 89][:db/retract 4 :l 6]])
我们应该如何在单个向量中合并向量?
答案 0 :(得分:4)
给出
(def v '([[:db/retract 1 :a 23] [:db/retract 1 :b 34]] [[:db/retract 2 :v 45] [:db/retract 2 :o 89]] [[:db/retract 4 :l 6]]))
你可以使用
(apply concat v)
获取
([:db/retract 1 :a 23] [:db/retract 1 :b 34] [:db/retract 2 :v 45] [:db/retract 2 :o 89] [:db/retract 4 :l 6])
如果您确实需要列表中的内部向量,请使用
`(~(vec (apply concat v)))
获取
([[:db/retract 1 :a 23] [:db/retract 1 :b 34] [:db/retract 2 :v 45] [:db/retract 2 :o 89] [:db/retract 4 :l 6]])