There seems to be an issue with the rebinding of loop-bindings using loop/recur in go blocks,
specifically when you are just changing the order of the original bindings in a recur call.
Take this snippet for example:
(require '[clojure.core.async :refer [go timeout]])
(go (loop [a :black, b :white]
(println a b)
(<! (timeout 1000))
(recur b a)))
Instead of repeatedly printing
:black :white
:white :black
:black :white
:white :black
(...)
it actually prints
:black :white
:white :white
:white :white
:white :white
(...)
Note however, that
(require '[clojure.core.async :refer [go timeout]])
(go (loop [a :black, b :white]
(println a b)
(<! (timeout 1000))
(recur (identity b) (identity a))))
works correctly.
Any ideas as to what's causing this?
Cheers,
Kevin