On Tue, Aug 27, 2013 at 10:51 AM, Mike Anderson < [email protected]> wrote:
> To me it's all about consistency with other Clojure constructs. You can > safely put nils in sequences, vectors, lists, sets etc.. nil is a valid > "value" just like anything else. So why can't you put them in a channel? > Channels are *not* data structures nor are they a "place" to put something. > a) what if you want to send a sequence through a channel? Since nil as a > value represents the empty sequence, you have to put in some extra special > case handling with the current core.async model. > You're not going to put random sequences into channels. Channels are conduits for meaningful messages - some well considered coordination protocol. > Both of these, I think, are reasonable and common enough use cases that > it's worth supporting them elegantly rather than forcing users to implement > their own nil-wrapping functionality. > If you're putting arbitrary sequences into a channel and need to wrap nils, you probably need to redesign your coordination protocol. David -- -- 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.
