(def ch (chan))
(go (println "Done" (>! ch 42))
Never prints "Done". I used >! instead of alt! here, because in the mean time I found out that it has the same behaviour.
And from the docs to 'close!':
"Logically closing happens after all puts have been delivered. Therefore, any
blocked or parked puts will remain blocked/parked until a taker releases them."
I conclude this is indeed intended bahaviour (one can/must still read all pending writes after the call to close).
But as I said, the docs for >! or alt! only contain the little word "already [closed]" to indicate that.
As a background: we have our own implementation of a variant of a 'pub sub' channel, and threads that try so send something to subscribers. But using 'close!' on the subscriber side can be a big source of problems then - as it sometimes 'works', but deadlocks the publisher if the channel is closed at the wrong time.