当我意外地将由函数返回的列表传递给update-in,而不是向量时,这让我感到困惑。
示例
`
some-app.core=> (update-in [:a :b :c] [1] name)
[:a "b" :c]
some-app.core=> (update-in '(:a :b :c) [1] name)
NullPointerException clojure.core/name (core.clj:1518)
`
如果在传递另一个函数的情况下也出现类似的结果;例如
`
some-app.core=> (update-in ["a" "b" "c"] [1] str/capitalize)
["a" "B" "c"]
some-app.core=> (update-in '("a" "b" "c") [1] str/capitalize)
NullPointerException clojure.string/capitalize (string.clj:199)
`