Huh, that is pretty clever. You're right, I just assumed I was seeing the body result. That is a pretty clever way to fix the issue. nil just closes the returned channel, causing future takes on it to return nil. Neat.
On Saturday, December 14, 2013 11:18:07 AM UTC-8, Stephen Cagle wrote: > > core.async discourages you from placing nil in a channel, as nil is only > taken when the channel has been closed. However, if I create a go block > with a body that evaluates to nil, core.async will return a channel that > contains nil. This is a nil as a take! value, not a nil to indicate the > channels closed state. Is there any ruling/best practices/thoughts about > whether this is correct behavior? Is it a anti-pattern to actually take > from a go block itself? Perhaps I should only be taking from channels that > I pass into the go block in order to avoid the above issue? > -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
