How do you know where the nil is coming from? Channels never accept nil, so any nil you get from a take is due to the channel bing closed. And yes, returning nil from a go causes the go's channel to close without a put.
Timothy On Sat, Dec 14, 2013 at 4:35 PM, Brandon Bloom <[email protected]>wrote: > Sounds like a bug to me. A nil value in return position of a go block > should probably close the channel. > > > On Saturday, December 14, 2013 2:18:07 PM UTC-5, 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. > -- “One of the main causes of the fall of the Roman Empire was that–lacking zero–they had no way to indicate successful termination of their C programs.” (Robert Firth) -- -- 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.
