go宏对用户代码进行了哪些转换? [英] What transformation is go macro doing to the user’s code?

查看:68
本文介绍了go宏对用户代码进行了哪些转换?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

It is a state machine at the back. You can read more in The State Machines of core.async

这篇关于go宏对用户代码进行了哪些转换?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆