网上演示 ClojureScript 的代码, 提到 >!
不能解决的问题, 用 put!
就解决了,
我本来还以为两者是同一个函数的不同写法, 看起来是有区别的?
(go
(let [c (chan)]
(>! c "hello")
(.write js/document (<! c))
(close! c)))
;; put! version
(go
(let [c (chan)]
(put! c "hello")
(.write js/document (<! c))
(close! c)))