简体   繁体   English

go 宏对用户的代码做了什么转换?

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

How go macro transforms the 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")))

It is a state machine at the back.它是后面的状态机。 You can read more in The State Machines of core.async您可以在core.async 的状态机中阅读更多内容

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM