Hello everyone,
(I am posting here because I could not find a dedicated core.async group)

recently I made a rather obscure bug-report (ASYNC-29). As a comment Rich 
Hickey stated that <!! and >!! should not be used in library code. I can 
now reproduce the same problem without <!!/>!! by simply derefing 50 
undelivered promises in dedicated go-blocks (dotimes [_ 50] (go 
@(promise))). After that it is not possible to take from channels inside 
go-blocks. 

Now I can imagine that using promises in go-blocks is not exactly doing 
what they are designed for. I suppose that using promises within go is not 
supported. However I wonder what my options as a library creator are when I 
want to write a function that is designed to wait until it has taken a 
value from a channel. The only way I can see is to write a macro instead of 
a function, two versions. One using <!, designed for use in go-blocks, one 
using <!!, designed for use outside of go blocks. Otherwise, I don't see 
any possible way to get a value from a channel and returning it. Or am I 
missing something?

Is it simply unidiomatic to return a value from a channel from a function 
body? 

Best regards,
 Leon.

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to