1
votes

Clojure async put! docs says (emphasis added)

Asynchronously puts a val into port, calling fn0 (if supplied) when complete. nil values are not allowed. Will throw if closed. If on-caller? (default true) is true, and the put is immediately accepted, will call fn0 on calling thread. Returns nil.

Yet the example code returns true

user=> (put! c "XYZ")
true

Are the docs incorrect or am I missing something?

1

1 Answers

1
votes

This was fixed in this commit, the new doc string reads:

"Asynchronously puts a val into port, calling fn1 (if supplied) when
complete, passing false iff port is already closed. nil values are
not allowed. If on-caller? (default true) is true, and the put is
immediately accepted, will call fn1 on calling thread.  Returns
true unless port is already closed."