我偶然遇到了这个问题
Clojure
(get {:x (reduced 10)} :x)
=> #object[clojure.lang.Reduced 0x28494b99 {:status :ready, :val 10}]
(get-in {:x (reduced 10)} [:x])
=> #object[clojure.lang.Reduced 0x28494b99 {:status :ready, :val 10}]
ClojureScript
(get {:x (reduced 10)} :x)
=> #object[cljs.core.Reduced]
; 与 Clojure 同样的行为
(get-in {:x (reduced 10)} [:x])
=> 10
所以 get-in
在 ClojureScript 中似乎会自动 deref
reduced
值吗?