Isn't core.async contrary to Clojure principles?

后端 未结 6 2283
日久生厌
日久生厌 2021-02-01 13:45

I have seen many Clojure programmers enthusiastic about the new core.async library and, though it seems very interesting, I am having a hard time seeing how it conforms to Cloju

6条回答
  •  没有蜡笔的小新
    2021-02-01 14:11

    perhaps a possible solution to use ( outside go macro could be done with macro and its macro expansion time :

    This is my example:

    (ns fourclojure.asynco
          (require [clojure.core.async :as async :refer :all]))
    
    (defmacro runtime--fn [the-fn the-value]
      `(~the-fn ~the-value)
      )
    (defmacro call-fn [ the-fn]
      `(runtime--fn ~the-fn (

    And to test it:

    (read-channel print)
    (repeatedly 50 paint)
    

    I've tried this solution in a nested go and also works. But I'm not sure if it could be a correct path

提交回复
热议问题