Well, for anyone interested, my solution was this macro:
(defmacro forcatv [[element-sym coll] & body]
`(loop [acc# [] coll# ~coll]
(if-let [~element-sym (first coll#)]
(recur (into acc# (do ~@body)) (next coll#))
acc#)))
That allows me to mapcat in a way that the go macro is able to rewrite my mapcat as well, since there is no longer a function boundary. So now I can do:
(async/<!!
(async/go
(forcatv [e [1 2 3]]
(async/<!
(doto (async/chan)
(async/put! [e])
(async/close!))))))
Which got me curious, anyone knows of a library that provides not boundary crossing variants of most sequence functions?
For use with core.async