簡體   English   中英

go 宏對用戶的代碼做了什么轉換?

[英]What transformation is go macro doing to the user’s code?

go宏如何轉換代碼

(let [c1 (chan)
      c2 (chan)]
  (go (while true
        (let [[v ch] (alts! [c1 c2])]
          (println "Read" v "from" ch))))
  (go (>! c1 "hi"))
  (go (>! c2 "there")))

它是后面的狀態機。 您可以在core.async 的狀態機中閱讀更多內容

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM