根据索引合并clojure中地图的两个向量
我在 clojure 中有两个地图向量,我希望将它们合并,使其成为单个地图向量,但每个索引处的地图都被合并。我只是想知道做到这一点的最佳方法。
例如:
[{:sku "e1" :name "example1"} {:sku "e2" :name "example2"}]
[{:color "Blue" :price 9.99} {:color "Red" :price 15.99}]
将合并到:
[{:sku "e1" :name "example1" :color "Blue" :price 9.99} {:sku "e2" :name "example2" :color "Red" :price 15.99}]
I have two vectors of maps in clojure, and I wish to merge them so that it is a single vector of maps, but the maps at each index are merged. I was just wondering the best way to do this.
For example:
[{:sku "e1" :name "example1"} {:sku "e2" :name "example2"}]
[{:color "Blue" :price 9.99} {:color "Red" :price 15.99}]
Would be merged to:
[{:sku "e1" :name "example1" :color "Blue" :price 9.99} {:sku "e2" :name "example2" :color "Red" :price 15.99}]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用
mapv
和合并
:Use
mapv
andmerge
: