【发布时间】:2013-12-30 21:35:50
【问题描述】:
在 Clojure 的 core.async library 中,我们看到 macro that creates a state machine 环绕 go 块以创建处理阻塞 IO 的通道。
这似乎是modelling on C#'s async and on Go-lang's goroutines。
在Seasoned Schemer - 他们描述techniques for passing continuations。 (这似乎是based on call/cc)。我们还在 Clojure 中的 delimited continuations 上看到了来自 David Nolen 的库。
Here they describe C#'s async 为“call with current continuation”。
我的问题是我们可以将 Clojure 的 core.async 描述为“continuation passing style”吗?
或者“延续”(delimited and undelimited)是一个重载的术语?
编辑: 另外一点 - David Nolen has said wrt to core.async:
在 go 块中,它给您一种错觉,即您可以以同步的方式执行这些操作,这样您就不必手动编写延续传递样式的代码。
【问题讨论】:
标签: clojure continuations goroutine callcc core.async