[英]Why doesn't this clojure code using go blocks work?
(defn ff [t]
(let [ch (chan 5)]
(map (fn [i]
(println i)) t)
(go (>! ch 0))))
(ff [1 2 3 4 5])
映射函數體沒有被執行。 如果我刪除最后一行中的 go 塊,它會按預期工作。
這個函數給出了同樣的問題:
(defn ff [t]
(let [ch (chan 5)]
(map (fn [i]
(println i)) t)
(>!! ch 0)))
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.