I started using the core.async clojure library. I realized that CSP concepts, channels, go blocks are very easy to use. However, I am not sure if I use them correctly. I have the following code -
(def x-ch (chan))
(def y-ch (chan))
(def w1-ch (chan))
(def w2-ch (chan))
; they all return matrices
(go (>! x-ch (Mat/* x (map
(go (>! y-ch (Mat/* y (map
(go (>! w1-ch (gen-matrix 200 300)))
(go (>! w2-ch (gen-matrix 300 100)))
(let [x1 (<!! (go (<! x-ch)))
y1 (<!! (go (<! y-ch)))
w1 (<!! (go (<! w1-ch)))
w2 (<!! (go (<! w2-ch)))]
;; do stuff w/ x1 y1 w1 w2
)
() x
y
. , . . . go
, go . let, . <!!
, .
, , , , . ?