【发布时间】:2013-08-20 02:11:12
【问题描述】:
我是 clojure 的新手,我已经盯着这个有一段时间了,我敢肯定有一些基本的东西我只是看不到。我想合并两组,但它们是嵌套的,例如:
(def foo {:b #{:test}})
(def bar {:a {:b #{:ab}} :c :d})
我试过了:
=>(update-in bar [:a :b] conj (:b foo) )
{:a {:b #{#{:test} :ab}}, :c :d}
我想这是有道理的,但我想要的是 {:a {:b #{:test :ab}}, :c :d}
我似乎无法从集合中取出 #{:test} 来组合它,或者在给定 update-in 语法的情况下正确访问 :b 作为集合。
非常感谢任何帮助。
【问题讨论】:
标签: clojure