News for hackers. Stuff that matters.
Re:Go Bloviations by ulber on Tuesday September 25, 2012 @03:08AM (#4569052)
On the "violating time and space" issue, I don't think the problem was on there being both blocking and non-blocking channel reads. Instead the problem for him was that in his mind the channel read "happens first" and how the result from that read is used (i.e. what it is assigned to) shouldn't have any effect on the read anymore. I must say that I agree and would prefer to have a more clearly separate syntax for blocking and non-blocking reads.
Re:Go Bloviations by cmccabe on Tuesday September 25, 2012 @03:20AM (#4569084)
Yeah, it's arbitrary that val, ok := <- ch does something different than val := <- ch, but any other convention for differentiating blocking from nonblocking would be just as arbitrary. I think it's something I would get used to after a while.
Re:Go Bloviations by ajanuary on Tuesday September 25, 2012 @06:44AM (#4569634)
It's not so much arbitrary as an exception. "The RHS is evaluated and assigned to the LHS, except in this edge case". Using a different syntax would be just as arbitrary, but less of an exception e.g. val, ok := <- ch, val := <~ ch still follows the expected order of evaluation.
Re:Go Bloviations by Jabbles on Tuesday September 25, 2012 @05:54AM (#4569511)
It certainly does, but they're both blocking.

http://news.ycombinator.com/item?id=4569456

Re:Go Bloviations by cmccabe on Tuesday September 25, 2012 @04:35PM (#4572519)
Thanks for the correction. Back when I first used go, they did different things. The change makes sense, I think-- we already have select for nonblocking I/O.